Unix MCQ Questions with Answers #4

1) Which of the following is not true

a. Sorting is done on the basics of first character of each line
b. Sort command sorts a file word by word rather than line by line
c. Sort command has s provision to do a numeric sort
d. Sort is not a filter
 

2) To change the access time of a file to 12:40 PM on 26th Jan 1997 the command would be

a. Touch –a 2601971240 file
b. Touch –a 1240260197 file
c. Touch –a 0126124097 file
d. Touch –a 9701261240 file
 

3) The command cut –f 2,8 –d”:”file I would output

a. The fields 2 to 8 from file I where delimiter between fileds is:
b. The fields 2 to 8 from file I including the delimiter : between fields
c. The columns 2 to 8 from file I with : between each column
d. None of the above
 

4) The command to search the pattern “Hi there” in file I would be

a. Grep “Hi there” file 1
b. Grep Hi there file 1
c. Grep \<Hi there\> file1
d. Grep ‘Hi there’ file 1
 

5) The command head f1 would display

a. First line of the file f1
b. Nothing
c. First 10 lines of the file f1
d. The whole file f1
 

6) After you have entered text in your file, to save and quit vi you will use

a. Esc shift ZZ
b. Shift ZZ
c. Esc:q Enter
d. None of the above
 

7) To search a pattern which starts with uni the command would be

a. :/ \<uni
b. :\ /<uni
c. :/ \<uni\>
d. :/ \<uni\
 

8) In command :l,.s/part/PART/g,g stands for

a. Grep
b. A numeric value which is to be substituted by a number
c. Global
d. Ignore case whilesearching
 

9) To delete 5 limes from a file that you are editing and copy them to a buffer named x you would use the command

a. “x5dd
b. “dd5x
c. “5xdd
d. “d5xd
 

10) Which of the following statements are not true

a. You can yank lines from one file and paste them in to another file
b. To setup new abbrevations the command is to be issued in command mode
c. To unabbrivate the macro the command is :u<abbreciation>
d. List of all abbreviations that have been set can be seen through the command :set abbr
e. All are false

---

Correct Answers

  1) B

  2) C

  3) A

  4) A

  5) C

  6) A

  7) A

  8) C

  9) A

10) E

Unix Tips

See Also

Have a Unix Problem
Do you have a UNIX Question?

Unix Books :-
UNIX Programming, Certification, System Administration, Performance Tuning Reference Books

Return to : - Unix System Administration Hints and Tips

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
All product names are trademarks of their respective companies.
The site www.gotothings.com is in no way affiliated with or endorsed by any company listed at this site.
Any unauthorised copying or mirroring is prohibited.