Here’s a comprehensive set of 50 Multiple Choice Questions (MCQs) on Unix Operating System with answers and explanations:
Unix Operating System – MCQ (50 Questions)
1. Unix was originally developed at:
a) Microsoft
b) AT&T Bell Labs
c) IBM
d) Apple
Answer: b) AT&T Bell Labs
Explanation: Unix was created in 1969 at AT&T Bell Labs by Ken Thompson, Dennis Ritchie, and others.
2. The core of the Unix OS is called:
a) Shell
b) Kernel
c) Terminal
d) GUI
Answer: b) Kernel
Explanation: The kernel is the core component that manages hardware, memory, and processes.
3. Which command displays the current directory in Unix?
a) pwd
b) ls
c) cd
d) who
Answer: a) pwd
Explanation: pwd (Print Working Directory) shows the current directory path.
4. The Unix command to list files is:
a) dir
b) list
c) ls
d) show
Answer: c) ls
Explanation: ls lists files and directories in the current folder.
5. Which command changes file permissions in Unix?
a) chmod
b) chown
c) perm
d) setperm
Answer: a) chmod
Explanation: chmod (Change Mode) modifies file permissions (read, write, execute).
6. The Unix command to create a new directory is:
a) mkdir
b) newdir
c) cdir
d) dir
Answer: a) mkdir
Explanation: mkdir (Make Directory) creates a new directory.
7. Which command displays manual pages in Unix?
a) help
b) info
c) man
d) doc
Answer: c) man
Explanation: man (Manual) provides documentation for commands.
8. The Unix command to remove a file is:
a) del
b) rm
c) erase
d) remove
Answer: b) rm
Explanation: rm (Remove) deletes files or directories.
9. Which command searches for text in files?
a) find
b) grep
c) search
d) locate
Answer: b) grep
Explanation: grep (Global Regular Expression Print) searches for patterns in files.
10. The Unix command to display file contents is:
a) type
b) cat
c) open
d) read
Answer: b) cat
Explanation: cat (Concatenate) displays file contents.
11. Which command shuts down a Unix system?
a) exit
b) halt
c) shutdown
d) poweroff
Answer: c) shutdown
Explanation: shutdown safely powers off the system.
12. The Unix command to copy files is:
a) copy
b) cp
c) mv
d) dup
Answer: b) cp
Explanation: cp (Copy) duplicates files or directories.
13. Which command moves or renames files?
a) move
b) mv
c) rename
d) shift
Answer: b) mv
Explanation: mv (Move) renames or relocates files.
14. The Unix command to display disk usage is:
a) disk
b) df
c) du
d) space
Answer: b) df
Explanation: df (Disk Free) shows disk space usage.
15. Which command compresses files in Unix?
a) zip
b) gzip
c) compress
d) pack
Answer: b) gzip
Explanation: gzip compresses files using GNU zip.
16. The Unix command to extract files from a tar archive is:
a) untar
b) tar -xvf
c) extract
d) unpack
Answer: b) tar -xvf
Explanation: tar -xvf extracts files from a .tar archive.
17. Which command displays running processes?
a) ps
b) top
c) jobs
d) list
Answer: a) ps
Explanation: ps (Process Status) lists active processes.
18. The Unix command to kill a process is:
a) stop
b) kill
c) end
d) terminate
Answer: b) kill
Explanation: kill terminates processes by PID (Process ID).
19. Which command changes file ownership?
a) chmod
b) chown
c) chgrp
d) own
Answer: b) chown
Explanation: chown (Change Owner) modifies file ownership.
20. The Unix command to schedule tasks is:
a) at
b) cron
c) schedule
d) timer
Answer: b) cron
Explanation: cron automates recurring tasks via cron jobs.
21. Which command displays system information?
a) sysinfo
b) uname
c) info
d) system
Answer: b) uname
Explanation: uname -a shows OS and kernel details.
22. The Unix command to count lines in a file is:
a) count
b) wc -l
c) lines
d) len
Answer: b) wc -l
Explanation: wc -l (Word Count) counts lines in a file.
23. Which command compares two files?
a) diff
b) cmp
c) compare
d) same
Answer: a) diff
Explanation: diff highlights differences between files.
24. The Unix command to append to a file is:
a) >>
b) >
c) <<
d) |
Answer: a) >>
Explanation: >> appends output to a file (e.g., echo "text" >> file.txt).
25. Which command redirects output to a file?
a) >
b) <
c) |
d) &
Answer: a) >
Explanation: > overwrites a file with new output.
26. The Unix command to filter text is:
a) awk
b) sed
c) cut
d) filter
Answer: a) awk
Explanation: awk processes and analyzes text patterns.
27. Which command archives files?
a) zip
b) tar
c) gzip
d) rar
Answer: b) tar
Explanation: tar (Tape Archive) bundles files into a single archive.
28. The Unix command to edit files is:
a) edit
b) vi
c) nano
d) emacs
Answer: b) vi
Explanation: vi is a standard Unix text editor.
29. Which command displays the last lines of a file?
a) head
b) tail
c) end
d) last
Answer: b) tail
Explanation: tail shows the last 10 lines by default.
30. The Unix command to find files is:
a) search
b) find
c) locate
d) where
Answer: b) find
Explanation: find searches for files by name, size, or type.
31. Which command checks disk for errors?
a) chkdsk
b) fsck
c) diskcheck
d) scandisk
Answer: b) fsck
Explanation: fsck (File System Check) repairs disk errors.
32. The Unix command to change user password is:
a) passwd
b) chpass
c) setpass
d) newpass
Answer: a) passwd
Explanation: passwd updates a user’s password.
33. Which command displays environment variables?
a) env
b) set
c) echo $PATH
d) var
Answer: a) env
Explanation: env lists all environment variables.
34. The Unix command to clear the terminal is:
a) cls
b) clear
c) clean
d) reset
Answer: b) clear
Explanation: clear clears the terminal screen.
35. Which command runs a script in the background?
a) bg
b) &
c) nohup
d) back
Answer: b) &
Explanation: Appending & to a command runs it in the background.
36. The Unix command to check network connectivity is:
a) netstat
b) ping
c) ifconfig
d) traceroute
Answer: b) ping
Explanation: ping tests network connection to a host.
37. Which command displays IP configuration?
a) ipconfig
b) ifconfig
c) netcfg
d) ipinfo
Answer: b) ifconfig
Explanation: ifconfig (Interface Config) shows network settings.
38. The Unix command to download files is:
a) wget
b) curl
c) fetch
d) download
Answer: a) wget
Explanation: wget retrieves files from the web.
39. Which command displays logged-in users?
a) users
b) who
c) last
d) log
Answer: b) who
Explanation: who lists currently logged-in users.
40. The Unix command to schedule a one-time task is:
a) at
b) cron
c) sleep
d) later
Answer: a) at
Explanation: at runs a command once at a specified time.
41. Which command checks file types?
a) type
b) file
c) stat
d) info
Answer: b) file
Explanation: file identifies a file’s type (e.g., text, binary).
42. The Unix command to sort file contents is:
a) order
b) sort
c) arrange
d) seq
Answer: b) sort
Explanation: sort arranges lines in alphabetical/numerical order.
43. Which command removes empty lines from a file?
a) grep -v "^$"
b) sed '/^$/d'
c) awk 'NF'
d) All of the above
Answer: d) All of the above
Explanation: All three commands filter out empty lines.
44. The Unix command to change group ownership is:
a) chmod
b) chown
c) chgrp
d) setgrp
Answer: c) chgrp
Explanation: chgrp (Change Group) modifies group ownership.
45. Which command displays command history?
a) history
b) past
c) log
d) mem
Answer: a) history
Explanation: history shows previously executed commands.
46. The Unix command to create symbolic links is:
a) ln -s
b) link
c) symlink
d) mklink
Answer: a) ln -s
Explanation: ln -s creates soft/symbolic links.
47. Which command checks disk space usage by directory?
a) df
b) du
c) diskusage
d) space
Answer: b) du
Explanation: du (Disk Usage) shows space used by directories.
48. The Unix command to update file timestamps is:
a) time
b) touch
c) update
d) stamp
Answer: b) touch
Explanation: touch updates access/modification times.
49. Which command lists open files?
a) openfiles
b) lsof
c) listfiles
d) fstat
Answer: b) lsof
Explanation: lsof (List Open Files) displays opened files/processes.
50. The Unix command to switch users is:
a) su
b) sudo
c) switch
d) login
Answer: a) su
Explanation: su (Switch User) changes the current user.
Conclusion
These 50 MCQs cover essential Unix commands, file management, permissions, processes, and system administration. Ideal for exams, quizzes, or interviews.