This comprehensive set of MCQs on the UNIX Operating System is designed to cover all essential topics necessary for mastering the concepts and functionalities of UNIX. Focused on key subjects such as file management, process control, shell scripting, system calls, and user permissions, these MCQs aim to help students and professionals build a strong foundation in UNIX, which is a vital operating system in many computing environments.
Who should practice UNIX Operating System MCQs?
• Students pursuing degrees in computer science, information technology, or software engineering who need to understand the UNIX environment.
• Individuals preparing for exams or certifications that include UNIX as part of their curriculum.
• Anyone aiming to strengthen their skills in system administration, programming, and command-line interface operations in UNIX.
• Candidates looking to improve their understanding of file systems, process management, and shell scripting.
• Professionals seeking to enhance their proficiency in UNIX for practical applications in software development and system administration.
• Suitable for all students eager to develop their technical skills and gain confidence in using the UNIX Operating System effectively.
1. What is the core of the Unix operating system?
a) Shell
b) Kernel
c) Command
d) Script
View Answer
B
2. Which command is used to change the current directory in Unix?
a) cd
b) chdir
c) cdir
d) mv
View Answer
A
3. Which command is used to list all the files in a directory in Unix?
a) ls
b) dir
c) list
d) show
View Answer
A
4. What does the `pwd` command do in Unix?
a) Prints the current directory
b) Changes the current directory
c) Deletes a directory
d) Creates a directory
View Answer
A
5. Which symbol is used to redirect output to a file in Unix?
a) >
b) <
c) |
d) &
View Answer
A
6. What is the purpose of the `grep` command in Unix?
a) To search for patterns in files
b) To copy files
c) To move files
d) To delete files
View Answer
A
7. Which command is used to display the content of a file in Unix?
a) cat
b) open
c) show
d) disp
View Answer
A
8. How do you terminate a process in Unix?
a) kill
b) end
c) stop
d) terminate
View Answer
A
9. What does the `chmod` command do in Unix?
a) Changes file permissions
b) Changes file owner
c) Changes file group
d) Changes file name
View Answer
A
10. What is the `vi` editor used for in Unix?
a) Editing files
b) Viewing files
c) Deleting files
d) Moving files
View Answer
A
11. Which command is used to display the first few lines of a file in Unix?
a) head
b) tail
c) top
d) start
View Answer
A
12. Which command is used to display the last few lines of a file in Unix?
a) tail
b) head
c) bottom
d) end
View Answer
A
13. What does the `ps` command display in Unix?
a) Current processes
b) Current users
c) Current directories
d) Current files
View Answer
A
14. Which command is used to compare the contents of two files in Unix?
a) diff
b) cmp
c) com
d) match
View Answer
A
15. What is the default shell in Unix?
a) Bourne Shell (sh)
b) C Shell (csh)
c) Korn Shell (ksh)
d) Bash Shell
View Answer
A
16. Which command is used to remove a directory in Unix?
a) rmdir
b) deldir
c) removedir
d) dirdel
View Answer
A
17. What does the `man` command do in Unix?
a) Displays the manual pages for commands
b) Manages files
c) Moves files
d) Mounts filesystems
View Answer
A
18. Which command is used to copy files in Unix?
a) cp
b) copy
c) mv
d) cpy
View Answer
A
19. What is a pipe (`|`) used for in Unix?
a) To send the output of one command as input to another
b) To combine two files
c) To delete files
d) To rename files
View Answer
A
20. Which command is used to create a new file in Unix?
a) touch
b) new
c) create
d) mkfile
View Answer
A
21. What does the `df` command do in Unix?
a) Displays disk space usage
b) Deletes files
c) Formats disks
d) Defrags disks
View Answer
A
22. Which command is used to move files in Unix?
a) mv
b) move
c) trans
d) shift
View Answer
A
23. What does the `uname` command do in Unix?
a) Displays system information
b) Changes the username
c) Displays user information
d) Updates the name
View Answer
A
24. What does the `who` command display in Unix?
a) Lists logged-in users
b) Displays system uptime
c) Shows process information
d) Lists current directories
View Answer
A
25. Which command is used to change the password in Unix?
a) passwd
b) changepwd
c) setpwd
d) updatepwd
View Answer
A
26. What does the `find` command do in Unix?
a) Searches for files in a directory hierarchy
b) Finds text within files
c) Finds system errors
d) Finds installed software
View Answer
A
27. Which command is used to count the number of lines, words, and characters in a file in Unix?
a) wc
b) count
c) tally
d) lines
View Answer
A
28. What does the `top` command do in Unix?
a) Displays active processes
b) Displays top of the file
c) Moves files to top
d) Shows system logs
View Answer
A
29. Which command is used to display the date and time in Unix?
a) date
b) datetime
c) time
d) showdate
View Answer
A
30. Which command is used to change the owner of a file in Unix?
a) chown
b) owner
c) setowner
d) chngowner
View Answer
A
31. What does the `du` command do in Unix?
a) Displays disk usage
b) Deletes users
c) Updates system
d) Downloads files
View Answer
A
32. Which command is used to display the content of a file page by page in Unix?
a) more
b) less
c) view
d) page
View Answer
A
33. What does the `touch` command do if the file already exists in Unix?
a) Updates the file’s timestamp
b) Deletes the file
c) Creates a copy of the file
d) Renames the file
View Answer
A
34. Which command is used to print files in Unix?
a) lpr
b) print
c) pr
d) lp
View Answer
A
35. What does the `alias` command do in Unix?
a) Creates shortcuts for commands
b) Lists all aliases
c) Deletes files
d) Shows hidden files
View Answer
A
36. Which command is used to change the group of a file in Unix?
a) chgrp
b) group
c) setgrp
d) changegrp
View Answer
A
37. What does the `echo` command do in Unix?
a) Displays a line of text/string
b) Reads a line of text/string
c) Edits a line of text/string
d) Deletes a line of text/string
View Answer
A
38. What is the `awk` command used for in Unix?
a) Pattern scanning and processing language
b) File comparison
c) File compression
d) Network configuration
View Answer
A
39. Which command is used to display the running kernel version in Unix?
a) uname -r
b) kernel -v
c) version
d) sysinfo
View Answer
A
40. What does the `tar` command do in Unix?
a) Archives files
b) Compresses files
c) Transfers files
d) Removes files
View Answer
A
41. Which command is used to extract files from a tar archive in Unix?
a) tar -xvf
b) untar
c) extract
d) decompress
View Answer
A
42. What does the `export` command do in Unix?
a) Sets environment variables
b) Exports files
c) Imports files
d) Lists exported files
View Answer
A
43. What does the `bg` command do in Unix?
a) Resumes suspended jobs in the background
b) Lists background jobs
c) Starts a new job in the background
d) Stops background jobs
View Answer
A
44. Which command is used to bring a background job to the foreground in Unix?
a) fg
b) fr
c) br
d) frg
View Answer
A
45. What does the `env` command do in Unix?
a) Displays or sets environment variables
b) Lists running processes
c) Edits configuration files
d) Shows network settings
View Answer
A
46. Which command is used to compress files in Unix?
a) gzip
b) compress
c) zip
d) tar
View Answer
A
47. What does the `uname -a` command display in Unix?
a) All system information
b) Current directory
c) All user information
d) Network settings
View Answer
A
48. Which command is used to display the usage of disk space by file system in Unix?
a) df -h
b) du -h
c) space
d) usage
View Answer
A
49. What does the `kill -9` command do in Unix?
a) Forces a process to terminate
b) Restarts a process
c) Suspends a process
d) Lists all processes
View Answer
A
50. Which command is used to view hidden files in Unix?
a) ls -a
b) ls -h
c) showhidden
d) hidden
View Answer
A
51. Which command is used to display the file type in Unix?
a) type
b) file
c) ft
d) showtype
View Answer
B
52. What does the `tee` command do in Unix?
a) Reads from standard input and writes to standard output and files
b) Transfers files
c) Compresses files
d) Creates symbolic links
View Answer
A
53. Which command is used to display the current month’s calendar in Unix?
a) cal
b) date
c) calendar
d) month
View Answer
A
54. What is the purpose of the `ln` command in Unix?
a) Creates links between files
b) Lists files
c) Deletes files
d) Moves files
View Answer
A
55. Which command is used to display the process hierarchy in Unix?
a) pstree
b) ps
c) proctree
d) treeps
View Answer
A
56. What does the `ifconfig` command do in Unix?
a) Configures network interfaces
b) Installs software
c) Formats disks
d) Displays user information
View Answer
A
57. Which command is used to schedule a one-time task in Unix?
a) at
b) cron
c) schedule
d) task
View Answer
A
58. What does the `crontab` command do in Unix?
a) Schedules recurring tasks
b) Displays the current date
c) Terminates processes
d) Compresses files
View Answer
A
59. Which command is used to view the contents of a compressed file in Unix?
a) zcat
b) view
c) show
d) cat
View Answer
A
60. What is the purpose of the `mount` command in Unix?
a) Mounts a filesystem
b) Moves files
c) Deletes files
d) Lists filesystems
View Answer
A
61. Which command is used to unmount a filesystem in Unix?
a) umount
b) unmount
c) dismount
d) removemount
View Answer
A
62. What does the `ping` command do in Unix?
a) Tests network connectivity
b) Lists files
c) Deletes files
d) Formats disks
View Answer
A
63. Which command is used to display the amount of free and used memory in Unix?
a) free
b) meminfo
c) memory
d) memstat
View Answer
A
64. What does the `uptime` command display in Unix?
a) The system uptime
b) The current time
c) The number of users logged in
d) The system load average
View Answer
A
65. Which command is used to synchronize cached writes to persistent storage in Unix?
a) sync
b) cacheflush
c) flush
d) persist
View Answer
A
66. What is the purpose of the `chmod 755` command in Unix?
a) Sets file permissions to rwxr-xr-x
b) Sets file permissions to rw-r–r–
c) Sets file permissions to r-xr-xr-x
d) Sets file permissions to rwx——
View Answer
A
67. Which command is used to search the directory tree for files matching a pattern in Unix?
a) find
b) locate
c) search
d) grep
View Answer
A
68. What does the `locate` command do in Unix?
a) Finds files by name
b) Searches for text within files
c) Lists files in a directory
d) Displays the current directory
View Answer
A
69. Which command is used to print network connections, routing tables, and interface statistics in Unix?
a) netstat
b) ifconfig
c) route
d) ipconfig
View Answer
A
70. What does the `hostname` command do in Unix?
a) Displays or sets the system’s hostname
b) Lists connected devices
c) Configures network settings
d) Shows the current user
View Answer
A
71. Which command is used to check disk partitions and filesystems in Unix?
a) fdisk
b) fsck
c) df
d) diskpart
View Answer
A
72. What does the `fsck` command do in Unix?
a) Checks and repairs a filesystem
b) Formats a filesystem
c) Mounts a filesystem
d) Lists filesystems
View Answer
A
73. Which command is used to configure network interfaces in Unix?
a) ifconfig
b) netcfg
c) netif
d) intcfg
View Answer
A
74. What does the `scp` command do in Unix?
a) Securely copies files between hosts
b) Copies files within the same host
c) Compresses files
d) Creates symbolic links
View Answer
A
75. Which command is used to display user and group information in Unix?
a) id
b) userinfo
c) whoami
d) groups
View Answer
A
76. What does the `chroot` command do in Unix?
a) Changes the root directory for a command
b) Changes the owner of a file
c) Changes the permissions of a file
d) Changes the group of a file
View Answer
A
77. Which command is used to display the manual pages for commands in Unix?
a) man
b) help
c) info
d) doc
View Answer
A
78. What does the `exit` command do in Unix?
a) Closes the current shell session
b) Terminates a process
c) Logs out the current user
d) Shuts down the system
View Answer
A
79. Which command is used to print the last lines of a file in Unix?
a) tail
b) head
c) end
d) bottom
View Answer
A
80. What is the purpose of the `ssh` command in Unix?
a) To remotely log into another machine
b) To copy files between machines
c) To search for files
d) To display system information
View Answer
A
81. Which command is used to create a symbolic link in Unix?
a) ln -s
b) symlink
c) link -s
d) symb
View Answer
A
82. What does the `whoami` command display in Unix?
a) The current logged-in username
b) The hostname of the system
c) The current directory
d) The current shell
View Answer
A
83. Which command is used to display the list of all users currently logged in Unix?
a) who
b) users
c) w
d) listusers
View Answer
A
84. What does the `tr` command do in Unix?
a) Translates or deletes characters from input data
b) Transfers files
c) Truncates files
d) Tracks processes
View Answer
A
85. Which command is used to merge multiple files into a single file in Unix?
a) cat
b) merge
c) comb
d) join
View Answer
A
86. What does the `df` command display in Unix?
a) Disk space usage
b) File permissions
c) Process list
d) System uptime
View Answer
A
87. Which command is used to view the current user’s crontab entries in Unix?
a) crontab -l
b) crontab -e
c) crontab -r
d) crontab -v
View Answer
A
88. What is the purpose of the `nohup` command in Unix?
a) Runs a command immune to hangups
b) Kills a running process
c) Halts the system
d) Displays system logs
View Answer
A
89. Which command is used to display the path of the current directory in Unix?
a) pwd
b) path
c) current
d) dirpath
View Answer
A
90. What does the `gzip` command do in Unix?
a) Compresses files
b) Extracts files
c) Copies files
d) Deletes files
View Answer
A
91. Which command is used to print the first lines of a file in Unix?
a) head
b) tail
c) start
d) begin
View Answer
A
92. What does the `uptime` command display in Unix?
a) How long the system has been running
b) The system load average
c) The number of users logged in
d) All of the above
View Answer
D
93. Which command is used to display the content of a file one screen at a time in Unix?
a) more
b) less
c) cat
d) view
View Answer
A
94. What is the purpose of the `basename` command in Unix?
a) Strips directory and suffix from filenames
b) Displays the base directory
c) Shows file metadata
d) Lists all files
View Answer
A
95. Which command is used to change the priority of a process in Unix?
a) renice
b) nice
c) chpri
d) prio
View Answer
A
96. What does the `sort` command do in Unix?
a) Sorts lines of text files
b) Sorts files by size
c) Sorts directories by name
d) Sorts users by UID
View Answer
A
97. Which command is used to delete files in Unix?
a) rm
b) del
c) delete
d) remove
View Answer
A
98. What does the `passwd` command do in Unix?
a) Changes a user’s password
b) Displays a user’s password
c) Deletes a user’s password
d) Encrypts a user’s password
View Answer
A
99. Which command is used to display a brief description of a command in Unix?
a) whatis
b) desc
c) help
d) cmdinfo
View Answer
A
100. What does the `history` command do in Unix?
a) Displays the command history
b) Clears the command history
c) Saves the command history
d) Exports the command history
View Answer
A