About Unix

Following are some of the multiple choice questions on the Unix with answers that will help the students in developing their knowledge.

Unix MCQ

1. UNIX is a

  • Compiler
  • Interpreter
  • Operating System
  • linker

2. Which command is used to sort the lines of data in a file in reverse order

  • sort
  • sh
  • st
  • sort -r

3. Which set option is used with vi editor to display line numbers on screen?

  • nm
  • nu
  • ic
  • li

4. The following command can list out all the current active logins.

  • whoami
  • who am i
  • who
  • None of the above.

5. The chmod ugo+rw note command can be represented in octal notation as

  • chmod 555 note
  • chmod 666 note
  • chmod 444 note
  • chmod 333 note

6. The directory structure used in Unix file system is called

  • Hierarchical directory
  • Tree structured directory
  • Directed acyclic graph
  • All of above

7. Which command is used to print a file?

  • print
  • prn
  • pg
  • lp

8. Which command is used to remove the read permission of the file 'note' from both the group and others?

  • chmod go+r note
  • chmod go+rw note
  • chmod go-x note
  • chmod go-r note

9. Which of the following commands is used to absolutely assign all permissions to the owner, read and write permissions to the group and only executable permission to the others of the file note?

  • chmod 761 note
  • chmod 671 note
  • chmod 167 note
  • chmod 4=rwx, g=rw note

10. Which command will be used with vi editor to replace text from cursor to right?

  • r
  • R
  • s
  • S

11. Which of the following is not a feature of UNIX?

  • multitasking
  • multiuser
  • portability
  • easy to use

12. Which command is used to copy all files having the string chap and any two characters after that to the progs directory?

  • cp chap?? progs
  • cp chap* progs
  • cp chap[12] /progs/*.*
  • cp chap?? /progs/*

13. Which command is used to extract specific columns from the file?

  • cat
  • cut
  • grep
  • paste

14. Unix operating system is written in

  • Ada Language
  • Perl Language
  • C Language
  • Pascal Language

15. Which of the following commands is used to display the directory attributes rather than its contents?

  • ls -l -d
  • ls -l
  • ls -x
  • ls -F

16. Which of the following OS treats hardware as a file system?

  • UNIX
  • DOS
  • Windows NT
  • Both A & B

17. Which UNIX/Linux command is used to make all files and sub-directories in the directory “progs” executable by all users?

  • chmod −R a+x progs
  • chmod −R 222 progs
  • chmod −X a+x progs
  • Both A & B

18. Unix command to change the case of first three lines of file “shortlist” from lower to upper

  • $ tr ‘[a-z]’ ‘[A-Z]’ shortlist | head-3
  • $ head-3 shortlist | tr ‘[a-z]’ ‘[A-Z]’
  • $ tr head-3 shortlist ‘[A-Z]’ ‘[a-z]’
  • All of above

19. Which statement is not correct about “init” process in Unix?

  • It is generally the parent of the login shell.
  • It has PID 1.
  • It is the first process in the system.
  • All of above

20. In UNIX, ______________ creates three subdirectories: 'PIS' and two subdirectories 'progs' and data from just created subdirectory 'PIS'.

  • mdkir PIS/progs PIS/data PIS
  • mkdir PIS progs data
  • mkdir PIS/progs data
  • mkdir PIS PIS/progs PIS/data

21. A part of Windows 2000 operating system that is not portable is

  • Device Management
  • Virtual Memory Management
  • Processor Management
  • All of above

22. Match the following in Unix file system :List - I__________List - II(a) Boot block___________(i) Information about file system(b) Super block_________(ii) Information about file(c) Inode table________(iii) Storage space(d) Data block________(iv) Code for making OS readyCodes :____(a)  (b)  (c)  (d)

  • (iv)  (i)   (ii)  (iii)
  • (i)    (iii) (ii)  (iv)
  • (iii)  (i)   (ii)  (iv)
  • None of these

23. Which command Is used to change current directory to parent directory

  • Multiple Choice
  • cd.
  • cd..
  • none of these

24. Which command is used to change directory to the name beginning with a 'p'?

  • cd p
  • cd p?
  • cd p*
  • cd [p]

25. Match the following WINDOWS system calls and UNIX system calls with reference to process control and File manipulation.Windows(a) Create - process ()(b) WaitForSingleObject ()(c) CreateFile ()(d) CloseHandle ()UNIX(i) Open ()(ii) Close ()(iii) Fork ()(iv) Wait ()Code :(a) (b) (c) (d)

  • (iii) (iv) (i) (ii)
  • (iv) (iii) (i) (ii)
  • (iv) (iii) (ii) (i)
  • All of above

26. Consider the following statements :(a) UNIX provides three types of permissions* Read* Write* Execute(b) UNIX provides three sets of permissions* permission for owner* permission for group* permission for othersWhich of the above statement/s is/are true?

  • Only (a)
  • Only (b)
  • Both (a) and (b)
  • None of these

27. Linux partitions are created using the file system:

  • FAT
  • FAT32
  • EXT3
  • All of above

28. In Linux, the subdirectory that contains system configuration files including user passwords:

  • /boot
  • /usr
  • /proc
  • /etc

29. The environment variable in Linux, that contain a list of directories the shell automatically recognizes.

  • $PATH
  • $ENV
  • $USER
  • All of above

30. Find the odd man out:

  • tail
  • cut
  • wart
  • Both A & B

31. Which of the following changes permission to deny write permission to group and others?

  • Chmod go-w filex
  • Chmod go w filex
  • Chmod go=w filex
  • All of above

32. An example of a memory management system call in UNIX is:

  • fork
  • execve
  • sigaction
  • mmap

33. An example of a directory found in most UNIX system is:

  • usr
  • waitpid
  • brk
  • All of above

34. The “nice” command is used in Unix:

  • to decrease the priority of a process
  • to increase the priority of a process
  • to get the highest priority
  • both a and b

35. Which of the following is not an Unix Command ?

  • Whoami
  • wc
  • ls
  • put

36. A system call in Linux operating system to create a new child process, which is a copy of the parent process:

  • access
  • fork
  • flock
  • All of above

37. Which of the following set of Unix commands will always display “WELCOME” ?

  • export title=WELCOME; Echo $title
  • title = WELCOME; export $ title ; sh –c “echo $title”
  • title = WELCOME; echo $title
  • title = WELCOME; export title ; sh –c “echo $title”

38. Which of the following shell scripts will produce the output “my first script” ?

  • for i in my first script { echo –i $i}
  • for my first script; do echo –n; done
  • for i in my first script; do echo –i $i; done
  • for n in my first script; do echo –i $i; done

39. Which of the following statements is not true for UNIX Operating System ?

  • Major strength of UNIX Operating System is its open standards which enabled large number of organizations ranging from academicia to industries to participate in its development.
  • UNIX kernel uses modules with well specified interfaces and provides advantages like simplified testing and maintenance of kernel. It has better extensibility as the kernel is not monolithic.
  • UNIX is kernel based operating system with two main components viz. process management subsystem and file management subsystem.
  • Both A & B

40. Consider the following UNIX command:sort < in > temp; head -30 < temp; rm tempWhich of the following functions shall be performed by this command?

  • Sort, taking the input from "temp", prints 30 lines from temp and delete the file temp
  • Sort the file "temp", removes 30 lines from temp and delete the file temp
  • Sort, taking the input from "in" and writing the output to "temp" then prints 30 lines from temp on terminal. Finally "temp" is removed
  • None of these

41. A UNIX file system has 1 KB block size and 4-byte disk addresses. What is the maximum file size if the inode contains ten direct block entries, one single indirect block entry, one double indirect block entry and one triple indirect block entry?

  • 30 GB
  • 64 GB
  • 2 GB
  • 16 GB

42. A user level process in Unix traps the signal sent on a Ctrl + C input and has a signal handling routine that saves appropriate files before terminating the process. When a Ctrl + C input is given to this process, what is the mode in which the signal handling routine executes ?

  • User mode
  • Kernel mode
  • Superuser mode
  • All of above

43. Which one of the following options is not a shell in UNIX system?

  • Bourne Shell
  • C Shell
  • Korn Shell
  • Net Shell

44. Which command allows you to view your file 24 lines at a time ?

  • More
  • Cat
  • Pg
  • All of above

45. The Unix command used to find out the number of characters in a file is

  • nc
  • wc
  • chcnt
  • Both A & B

46. Assume that an implementation of Unix operating system uses i-nodes to keep track of data blocks allocated to a file. It supports 12 direct block addresses, one indirect block address and one double indirect block address. The file system has 256 bytes block size and 2 bytes for disk block address. The maximum possible size of a file in this system is

  • 16 MB
  • 16 KB
  • 70 KB
  • None of the above

47. Which of the following out commands will output "onetwothree"?

  • for val; do echo-n $val; done < one two three
  • for one two three; do echo-n-; done
  • for n in one two three; do echo-n $n; done
  • None of these

48. In Unix, files can be protected by assigning each one a 9-bit mode called rights bits. Now, consider the following two statements:I. A mode of 641 (octal) means that the owner can read and write the file, other members of the owner’s group can read it, and users can execute only.II. A mode of 100 (octal) allows the owner to execute the file, but prohibits all other access.Which of the following options is correct with reference to above statements?

  • Only I is correct
  • Only II is correct
  • Both I and II are correct
  • None of these

49. A unix file system has 1-KB blocks and 4-byte disk addresses. What is the maximum file size if i-nodes contain 10 direct entries and one single, double and triple indirect entry each?

  • 16 GB
  • 64 GB
  • 32 GB
  • None of these

50. In Unix, the login prompt can be changed by changing the contents of the file ...............

  • contrab
  • init
  • gettydefs
  • none of the above

Enjoyed the Quiz. Share this with friends


Add Your Review

Your email address will not be published.

Subscribe to Newsletter!

Subscribe to get latest updates and information.