Unix Question Bank / FAQs
This is a mock Exam for the Unix programmers. It is created by Genesis InSoft Limited (admin@genesisinsoft.com) and may be freely
distributed so long as it is unmodified. Please email us if you have any corrections or
comments.
Question1
To get the PID of last background process
- echo $#
- echo $!
- echo $0
- echo $$
Answer to Question 1
Question 2
The -v option of sh causes the shell to
- Debugs if shell script has any error
- Does nothing
- Echo each command before it is executed
- Gives verbal output
Answer to Question 2
Question 3
The option to o test for zero length string is
- -s
- -z
- -a
- -d
Answer to Question 3
Question 4
A file is identified by _____ associated with it
- Inode number
- Process-id number
- Group-id number
- User-id number
Answer to Question 4
Question 5
The default value of umask is
- 777
- 644
- 022
- 422
Answer to Question 5
Question 6
Which of the following command is used to find the largest capacity of a file (maximum
bytes a file can hold)
- Umask
- Ulimit
- FLargeLimit
- None of the above
Answer to Question 6
Question 7
Using ___ you can accept input from the standard input, process it and send the output
to the standard output
- Filters
- Pipe
- Both A and B
- None of the above
Answer to Question 7
Question 8
What is the internal value associated with the standard error device?
- 0
- 1
- 2
- None of the above
Answer to Question 8
Question 9
Block commands work
- On group of lines
- On single line
- On a single file
- None of the above
Answer to Question 9
Question 10
In which of the following modes vi (editor) works
- Command mode
- Insert mode
- Ex command mode
- All of the above
Answer to Question 10
Question 11
Which commands help in viewing lines at the beginning or at the end of the file?
- Touch and cat
- Head and tail
- Touch and head
- Cat and tail
Answer to Question 11
Question 12
Which of the following commands are used to save disk space?
- Ulimit
- Compress
- Pack
- Both B and C
Answer to Question 12
Question 13
What is the command for viewing a compressed file?
- cat
- touch
- zcat
- acat
Answer to Question 13
Question 14
Password created for a user is stored in a file
- /dev/passwd
- /usr/passwd
- /etc/passwd
- /bin/passwd
Answer to Question 14
Question 15
Which of the following is true?
- A DOS formatted floppy can be used in Unix and a Unix formatted floppy can be used in
DOS
- A DOS formatted floppy can be used in Unix but a Unix formatted floppy cannot be used in
DOS
- A Unix formatted floppy can be used in DOS but a DOS formatted floppy cannot be used in
Unix
- None of the above
Answer to Question 15
Question 16
Which of the following is a metacharacter?
- m>
- &&
- $1..$9
- All of the above
Answer to Question 16
Question 17
Block command works in
- Command mode
- Insert mode
- Ex command mode
- All of the above
Answer to Question 17
Question 18
How can you create hidden files in Unix
- *filename
- .filename
- $filename
- #filename
Answer to Question 18
Question 19
What happens when the following command is executed?
(date; banner welcome; ls)> one 2>two
- date along with the banner and list of all the files is written into files one and two
- date along with the banner and list of all the files is written only into file two
- date along with the banner and list of all the files is written only into file one
- syntax error
Answer to Question 19
Question 20
Which of the following command is used to execute commands at specified date and time?
- nohup
- cron
- fgrep
- None of the above
Answer to Question 20
Answers
Answer 1 - B
Back to question 1
Answer 2 - C
Back to question 2
Answer 3 - B
Back to question 3
Answer 4 - A
Back to question 4
Answer 5 - C
Back to question 5
Answer 6 - B
Back to question 6
Answer 7 - A
Back to question 7
Answer 8 - C
Back to question 8
Answer 9 - A
Back to question 9
Answer 10 - D
Back to question 10
Answer 11 - B
Back to question 11
Answer 12 - D
Back to question 12
Answer 13 - C
Back to question 13
Answer 14 - C
Answer 15 - B
Back to question 15
Answer 16 - D
Back to question 16
Answer 17 - C
Answer 18 - B
Answer 19 - C
Back to question 19
Answer 20 - B
Back to question 20
|