This document contains a quiz on Unix commands and concepts with 42 multiple choice questions. It covers topics like vi commands, file permissions, directories, ownership, searching, piping, sorting, and more. The questions test knowledge of basic Unix commands and operations for tasks like editing, navigation, permissions, processes, I/O redirection and more.
1. KMS
Unix Test
1. Which vi command should one use to delete the first 10 lines of a file
a. gg10dd
b. 10ggdd
c. 10dw
d. 10dd
2. Which vi command should one use to quit vi without saving any changes made?
a. :q
b. :q!
c. :quit
d. u
3. Assume m=100, n=25.5. choose the appropriate command for doing the calculation
1. $(m+n)
2. expr $m * $n
3. expr $m * $n
4. Error
4. When in Normal mode of vi, which command would you use to search for a word in a
file?
a. s
b. /
c. i
d. Esc
5. / command is used to search text in the ______ in Vi editor
a. forward direction
b. backward direction
c. any direction
d. reversed direction
2. KMS
6. Which of the following is not a file attribute in Unix?
a. file location
b. file size
c. creation time
d. file owner
7. What does the first character in the output of command “ls -l” represent?
a. Owner Read access
b. File Permission
c. File Type
d. None of the options
8. Which of the following is not a mode for tar
a. list
b. create
c. compress
d. extract
9. Which directory in UNIX usually stores the configuration files?
a. /bin
b. /conf
c. /etc
d. /home
10. Superuser can change only the following permissions on the file
1. owner
2. group owner
3. other users
4. all of the above
11. Which option of ls sorts the files according to their size?
a. ls -s
b. ls -S
c. ls -t
d. ls –h
3. KMS
12. Which command would you use to replicate a complete directory structure from one
location to another?
a. mv -r
b. cp
c. mv
d. cp –r
13. Which of the following Unix command is used to create an empty file?
a. ls
b. touch
c. chown
d. du
14. Which command can I use to modify the timestamp of a file?
a. touch
b. chmod
c. chtime
d. chown
15. Which of the following commands cannot be used to view the contents of a file?
a. ls
b. cat
c. vi
d. sort
16. Which of the following commands is used to list the contents of a directory ?
a. ls
b. mkdir
c. v
d. dirls
4. KMS
17. Which command can I used to change the owner and also the group of a file?
a. chgrp
b. chown
c. chmod
d. umask
18. Which command is used to delete an empty directory?
a. deldir
b. del
c. rm
d. rmdir
19. Which of the following is represented as a file on UNIX
a. directory
b. Shell script
c. printer
e. All of these
20 Which command is used to set the default permissions of a newly created file on
UNIX?
a. .bashrc
b. chown
c. chmod
d. umask
21. / command is used to search text in the ______ in Vi editor
a. forward direction
b. backward direction
c. any direction
d. reversed direction
5. KMS
21. Which UNIX command is used to convert a file to a read only file
a. readonly
b. chown
c. chmod
d. vi
22. ___ used to change the permissions of a file on UNIX
a. chrun
b. chown
c. chmod
d. vi
23. Which command need to give write permissions to a file emp.txt to all the users
belong to particular group ?
a. chmod a+w emp.txt
b. chmod g+w emp.txt
c. chmod u+w emp.txt
d. chmod u+gw emp.txt
24. What is the octal representation of the file owner’s mode : rw-
a. 5
b. 6
c. 42
d. 420
25. write permission is represented as _____ in octal system
a. 5
b. 6
c. 2
d. 4
26. What is the main purpose of an Operating System?
a. Connect me to internet
b. Install software
6. KMS
c. Interact with the user
d. Manage all system resources
27 Which of these is not a feature of UNIX
a. Consistency
b. Security
c. Multi-Tasking
d. Multi-user
28. This is not a type of Loop in Unix
1. while
2. for
3. do while
4. until
29. Which of the following are variants of UNIX?
a. System V
b. BSD
c. both of the above
d. Fedora
e. Ubuntu
30. Which of the foll. Command will list the output on screen as well as store output in
file
1. cat
` 2. more
3. tee
4. grep
31. Which of the following is not a UNIX shell
a. bash
b. wash
7. KMS
c. ksh
d. csh
32. This Shell Variable prints all the Arguments given on command line
1. $#
2. $*
3. $?
4. $9
33. This command of Unix displays arguments one by one when used in loop
1. seq
2. shift
3. exit
4. do…….done
34. Unix Command used to display matching pattern is
1. find
2. grep
3. search
4. All of the above
35. The pid of first Process in Unix is
1. 1
2. 4
3. 8
4. 10
36. Which of the foll. Command is used to terminate a process
1. quit
2. cancel
3. kill
8. KMS
4. remove
37. ppid is
1. Previous Process id
2. Parent Process id
3. Parent Previous id
4. none of the above
38. Which command for sorting a datafile in reverse
1. sh
2. srt
3. sort
4. sort -r
39. This Command can be used to extract a specific column from file
1. grep
2. cut
3. cat
4. paste
40. This Command will send the word count of file myfile into newfile
1. wc myfile
2. wc myfile | newfile
3. wc myfile > newfile
4. wc infile - newfile
41. Which of the following is not a communication command in unix
1. write
2. wall
9. KMS
3. speak
4. None of the above
42. This command in unix is used to remove an empty file
1. remove
2. del
3. rm
4. mv