Systems Programming - Unix Quiz Question and Answers - Part 3
Question 1: Write a command for clearing the screen.
Select one:
a. CTRL-D
b. erase
c. clear
d. delete
Question 2: Give any two names of propiretary unix
Select one:
a. CP/M, TRDOS
b. Solaris, Mac
c. DOS, WIndows
d. Xenix, Linux
Question 3: The grep command is used for sorting the content of a file on any of the fields in the data.
Select one:
True
False
Question 4: find / -name '*' will
Select one:
a. List a file named * in /
b. List all files and directories in / directory
c. List all files and directories recursively starting from /
d. List all files in / directory
Question 5: perl and awk are two names for the same programming language.
Select one:
True
False
Question 6: Which command is used to set terminal IO characteristic?
Select one:
a. ctty
b. stty
c. tty
d. ptty
Question 7: What is the difference between cd ~ ,cd .. ,cd . and cd /
Select one:
a.
cd .. will move you up one directory.
cd ~ will move you up one directory.
cd / takes you to absolute path
cd . will leave you in the same directory you are currently in.
b.
cd .. will leave you in the same directory you are currently in.
cd ~ Move to the user's home directory.
cd / takes you to absolute path
cd . will move you up one directory.
c.
cd .. will move you up one directory.
cd ~ Move to the user's home directory.
cd / takes you to absolute path
cd . will leave you in the same directory you are currently in
d.
cd .. will move you up one directory.
cd ~ will move you up one directory.
cd / takes you to root
cd . will leave you in the same directory you are currently in.
Question 8: How will you connect output of one command to input to other command?
Select one:
a. command > command
b. command || command
c. command | command
d. command pipe command
Question 9: A soft link does not have the same inode number as the original directory entry of the file which is being soft-linked.
Select one:
True
False
Question 10:What is the purpose of "rb" in fopen() function used below in the code?
FILE *fp;
fp = fopen("source.txt", "rb");
Select one:
a. Create a new file "source.txt" for reading and writing
b. None of the stated options
c. open "source.txt" in binary mode for reading and writing
d. open "source.txt" in binary mode for reading
Question 11: The following piece of awk code
BEGIN { x=3 }
{ print x, $x}
Select one:
a. Does not execute as it waits for the END {} instruction.
b. It does not give any output.
c. prints two "fields" to standard out. The first field printed is the third field (or column) on the input line, the second field printed is the number "3".
d. prints two "fields" to standard out. The first field printed is the number "3", the second is the third field (or column) on the input line.
e. prints one "field" to standard out. It is the third field (or column) on the input line.
Question 12: AWK has an incredible useful feature which most computing languages lack. It is
Select one:
a. associative arrays
b. object oriented
c. interpreted oriented.
d. procedural
e. it is a dynamic programming languages
Question 13: Which command is used to print a file
Select one:
a. lpr
b. ptr
c. print
d. none of the given options
Question 14: What is the role of the kernel in UNIX?
Select one:
a. It handles the filestore and communications in response to system calls.
b. It allocates time and memory to programs and handles the filestore and communications in response to system calls.
c. It allocates memory to programs and handles communications in response to system calls. Incorrect
d. It allocates time and memory to programs.
Question 15: When you hard link a new directory entry is generated with the same inode number in the new entry as that in the old directory entry.
Select one:
True
False
Question 16: Which command is used to display the operating system name
Select one:
a. uname
b. myos
c. kernel
d. os
Question 17: The following piece of awk code
BEGIN { x=3 }
{ print x, $x}
Select one:
a. It does not give any output.
b. prints two "fields" to standard out. The first field printed is the third field (or column) on the input line, the second field printed is the number "3".
c. prints one "field" to standard out. It is the third field (or column) on the input line.
d. Does not execute as it waits for the END {} instruction.
e. prints two "fields" to standard out. The first field printed is the number "3", the second is the third field (or column) on the input line.
Question 18:The command
cmp file1 file2
indicated the line number and character number at which the two files file1 and file2 differ for the first time as you parse through both files.
Select one:
True
False
Question 19: Which command is used to record a user login session in a file
Select one:
a. read
b. script
c. none of the given choices
d. macro
Question 20:What does fp point to in the program ?
#include<stdio.h>
int main()
{
FILE *fp;
fp=fopen("trial", "r");
return 0;
}
Select one:
a. The name of the file.
b. The first character in the file
c. The last character in the file.
d. A structure which contains a char pointer which points to the first character of a file.
Question 21: Which option of ls command used to view file inode number
Select one:
a. -a
b. -l
c. -o
d. -i
Question 22: Write the difference between rm and mv command.
Select one:
a. rm remakes file, mv moves file.
b. rm removes file, mv moves file.
c. rm renames file, mv makes variable.
d. rm renames file, mv makes variable.
Question 23: Write a command to display files with permissions, number of hard links, owner, group, size, date and filename.
Select one:
a. ls -a
b. ls -l
c. ls -i
d. ls -o
Question 24: who | grep tulsi
will only show the details of the the user tulsi is she is logged in at the time this command is executed.
Select one:
True
False
Question 25: The name awk comes from
Select one:
a. Aho, Kernighan and Weinberger
b. a.w.k.jones, salty
c. awake my soul
d. awkward
Systems Programming - Unix Quiz Question and Answers - Part 3