We have listed here some multiple choice questions with answer on UNIX Operating System, Which has asked by multiple companies like Genpact, Syntel, Ericsson, Zensar, Virtusa etc.

You can prepare your job written and interview by using these sets of question fro here.

1. Multiple directories can be removed using single rmdir command.
a) True
b) False

Answer: a

2. Which one of the following commands is incorrect?
a) cat file01
b) cat > file01
c) cat >> file1
d) cat -a file01

Answer: d

3. What does the following command do?

cp -u * dir_file
a) copy all files to directory dir_file
b) update all files
c) delete all files
d) update all files in the current working directory and copy newer ones to directory dir_file

Answer: d

4. We can delete multiple files using single rm command.
a) True
b) False

Answer: a

5. Which command is used for renaming files?
a) rename
b) mv
c) cp
d) move

Answer: b

6. Which option is used for backing up destination file in mv command?
a) –b
b) –f
c) –v
d) –i

Answer: a

7. How can we skip some initial bytes from both the files to be compared?
a) using –b option
b) using –n option
c) using –l option
d) using –i option

Answer: d

8. Which command is used to display the differences between files?
a) comm
b) diff
c) cmp
d) differ

Answer: b

9. We cannot uncompress files using gzip.
a) True
b) False

Answer: b

10. What are links referred to as in file attributes?
a) number of filenames of a single file that are maintained by the system.
b) number of duplicates of a single file
c) number of copies of a single file.
d) number of files present in a directory

Answer: a

11. In how many categories are links divided?
a) 1
b) 2
c) 4
d) 0

Answer: b

12. If a file is read protected, we can write to the file.
a) True
b) False

Answer: b

13. A file has a permission set as 777 ie rwxrwxrwx but the directory permissions are 400. If the user tries to delete the file, will he be able to do it?
a) Yes
b) No

Answer: b

14. What is the default mode of vi editor?
a) Command mode
b) Input mode
c) Ex mode
d) Insert mode

Answer: a

15. Which one of the following key is used to switch from command mode to input mode?
a) i
b) :
c) esc
d) ;

Answer: a

16. The first UNIX editor was ____
a) emacs
b) ex
c) ed
d) vi

Answer: c

17. The “ed” text editor is no longer in use.
a) True
b) False

Answer: b

18. Which command will be used to insert text at the beginning of the line?
a) i
b) I
c) a
d) A

Answer: b

19. To replace 5 characters with new characters, which one of the following will be used?
a) s
b) 5S
c) 5s
d) S

Answer: c

20. To replace the entire line irrespective of cursor position, we can use ____ command
a) s
b) 10s
c) S
d) 10s

Answer: c

21. To save the editing performed on a file, we have to switch to ______ mode
a) command
b) input
c) ex
d) insert

Answer: c

22. Which one of the following is the best way for saving and quitting the editor?
a) ZZ
b) :wq
c) :w
d) ‘:x’

Answer: a

23. Which of the following is not a valid command?
a) : .,$w file002
b) :w 1,$ file002
c) : .w file002
d) : $w file002

Answer: b

24. To recover from a crash, we can use ____ command.
a) :recover
b) -r
c) : x
d) :recover and -r

Answer: d

25. Which one of the following command is invalid?
a) 20h
b) 5l
c) 4k
d) 3d

Answer: d