This comprehensive set of Linux Operating System MCQs is designed to cover all essential topics required for success in exams related to Linux administration and system management. Focused on key subjects such as Linux commands, file systems, shell scripting, process management, permissions, and network configuration, these MCQs are crafted to help students build a strong foundation in Linux operations.
Who should practice Linux Operating System MCQs?
- Students preparing for computer science, IT, or software engineering exams that include Linux operating system concepts.
- Individuals aiming to strengthen their knowledge of Linux commands, system administration, and network configuration.
- Candidates preparing for Linux certification exams such as CompTIA Linux+, LPIC, or Red Hat Certified System Administrator (RHCSA).
- Learners interested in mastering shell scripting, file management, process control, and user permissions in Linux.
- IT professionals focused on improving their skills in server management, troubleshooting, and Linux security practices.
- Suitable for all students and professionals seeking to enhance their performance in Linux-related tasks, exams, or certifications.
Â
1. Which command is used to list all the files and directories in Linux?
A) ls
B) list
C) show
D) dir
View AnswerA
2. What is the default shell in most Linux distributions?
A) Korn Shell
B) Z Shell
C) Bash Shell
D) C Shell
View AnswerC
3. Which Linux command is used to change the ownership of a file?
A) chown
B) chmod
C) change
D) chgroup
View AnswerA
4. In Linux, what does the ‘pwd’ command do?
A) It prints the working directory
B) It prints the permissions of a file
C) It displays the disk usage
D) It lists the files in a directory
View AnswerA
5. Which of the following is the package manager for Debian-based Linux distributions?
A) yum
B) rpm
C) apt
D) pacman
View AnswerC
6. What is the purpose of the ‘chmod’ command in Linux?
A) To change file permissions
B) To change file ownership
C) To move files
D) To create directories
View AnswerA
7. Which Linux command is used to display the contents of a file?
A) read
B) show
C) cat
D) copy
View AnswerC
8. How do you display the first 10 lines of a file in Linux?
A) head
B) top
C) cat
D) first
View AnswerA
9. What does the ‘mkdir’ command do in Linux?
A) It removes a directory
B) It changes the current directory
C) It creates a new directory
D) It lists the directories
View AnswerC
10. Which command is used to view running processes in Linux?
A) top
B) view
C) ps
D) htop
View AnswerA
11. What is the purpose of the ‘df’ command in Linux?
A) To display the disk usage
B) To format a disk
C) To check file system integrity
D) To display free space
View AnswerA
12. How can you view the manual pages for a Linux command?
A) help
B) man
C) info
D) explain
View AnswerB
13. Which of the following is the correct command to remove a directory in Linux?
A) deldir
B) removedir
C) rmdir
D) delete
View AnswerC
14. Which Linux command is used to display the current date and time?
A) date
B) time
C) clock
D) datetime
View AnswerA
15. What does the ‘whoami’ command in Linux return?
A) The current username
B) The current directory
C) The current user ID
D) The list of users
View AnswerA
16. In Linux, how do you check the IP address of your machine?
A) ipconfig
B) ifconfig
C) netconfig
D) iplookup
View AnswerB
17. Which command is used to compress files in Linux?
A) zip
B) compress
C) archive
D) tar
View AnswerD
18. What is the purpose of the ‘grep’ command in Linux?
A) To search for a string or pattern in a file
B) To compare two files
C) To move files
D) To copy directories
View AnswerA
19. Which Linux command is used to display the last few lines of a file?
A) end
B) tail
C) cat
D) less
View AnswerB
20. In Linux, which command is used to change the group ownership of a file?
A) chmod
B) chgrp
C) chown
D) changegrp
View AnswerB
21. What is the purpose of the ‘find’ command in Linux?
A) To search for files based on specific criteria
B) To locate installed packages
C) To display hidden files
D) To find a command’s location
View AnswerA
22. Which command is used to install packages in Red Hat-based Linux distributions?
A) apt
B) rpm
C) dpkg
D) yum
View AnswerD
23. What does the ‘kill’ command do in Linux?
A) It terminates a running process
B) It removes a file
C) It stops a user session
D) It deletes directories
View AnswerA
24. How do you create a symbolic link in Linux?
A) link
B) symlink
C) ln -s
D) mklink
View AnswerC
25. In Linux, what is the purpose of the ‘sudo’ command?
A) To grant administrative privileges to a user
B) To switch users
C) To run scripts
D) To list users
View AnswerA
26. What is the default location for system log files in Linux?
A) /usr/logs
B) /var/log
C) /log
D) /etc/logs
View AnswerB
27. What does the ‘uname’ command do in Linux?
A) Displays system information
B) Changes the username
C) Lists users
D) Shows the current directory
View AnswerA
28. How do you update the list of available packages in Debian-based Linux distributions?
A) sudo apt-get upgrade
B) sudo apt-get update
C) sudo apt-get install
D) sudo apt-cache
View AnswerB
29. In Linux, how do you schedule a task to run at a specific time?
A) cron
B) task
C) runat
D) jobs
View AnswerA
30. What does the ‘mv’ command do in Linux?
A) Moves or renames files and directories
B) Displays file contents
C) Copies files
D) Deletes files
View AnswerA
31. How can you check the memory usage in a Linux system?
A) free
B) memusage
C) checkmem
D) top
View AnswerA
32. What is the purpose of the ‘scp’ command in Linux?
A) To securely copy files between hosts
B) To create symbolic links
C) To change file permissions
D) To view system processes
View AnswerA
33. How do you forcefully remove a file in Linux?
A) rm
B) rm -f
C) del -f
D) delete -force
View AnswerB
34. Which command is used to see a list of all currently logged-in users?
A) who
B) users
C) whoami
D) logins
View AnswerA
35. What does the ‘ps’ command display in Linux?
A) A list of active processes
B) The current directory
C) The available disk space
D) Network configurations
View AnswerA
36. How do you stop a process in Linux?
A) kill
B) stop
C) terminate
D) end
View AnswerA
37. In Linux, which directory contains the configuration files?
A) /usr
B) /config
C) /home
D) /etc
View AnswerD
38. What is the purpose of the ‘mount’ command in Linux?
A) To attach a file system to the directory structure
B) To install packages
C) To update system files
D) To check disk usage
View AnswerA
39. Which Linux command is used to view the kernel version?
A) uname -r
B) version -k
C) kernel -v
D) sysinfo
View AnswerA
40. How do you view the permissions of a file in Linux?
A) ls -l
B) chmod
C) view -perm
D) cat -p
View AnswerA
41. Which command is used to display the disk usage of files and directories?
A) du
B) df
C) diskusage
D) size
View AnswerA
42. What does the command ‘tar -xvf’ do?
A) Extracts files from a tarball
B) Compresses files into a tarball
C) Lists files in a tarball
D) Verifies a tarball
View AnswerA
43. How do you find the path of a command in Linux?
A) path
B) which
C) whereis
D) locate
View AnswerB
44. In Linux, what is the significance of the /root directory?
A) It is the home directory for the root user
B) It stores temporary files
C) It contains system configuration files
D) It is a backup directory
View AnswerA
45. Which command is used to search for files in a directory hierarchy?
A) find
B) search
C) locate
D) grep
View AnswerA
46. What is the purpose of the ‘history’ command in Linux?
A) To display a list of previously executed commands
B) To check system logs
C) To view the current user’s history
D) To manage user accounts
View AnswerA
47. Which file contains user account information in Linux?
A) /etc/passwd
B) /etc/group
C) /etc/shadow
D) /etc/user
View AnswerA
48. What does the command ‘chmod 755 file.txt’ do?
A) Sets read and execute permissions for everyone and write for the owner
B) Sets full permissions for the owner and read for the group and others
C) Sets read and write permissions for everyone
D) Removes all permissions from the file
View AnswerB
49. In Linux, what is the purpose of the ‘wget’ command?
A) To download files from the web
B) To transfer files between systems
C) To copy files
D) To create backups
View AnswerA
50. Which command is used to view real-time system performance and resource usage?
A) uptime
B) top
C) sysinfo
D) performance
View AnswerB
51. What is the function of the ‘echo’ command in Linux?
A) To display a line of text or a variable’s value
B) To create a file
C) To remove a file
D) To copy text to the clipboard
View AnswerA
52. How can you display hidden files in a directory?
A) ls -a
B) ls -l
C) ls -h
D) ls -d
View AnswerA
53. What is the purpose of the ‘alias’ command in Linux?
A) To create a shortcut for a command
B) To change a file’s owner
C) To list all available commands
D) To remove a command
View AnswerA
54. Which command is used to change the priority of a running process in Linux?
A) nice
B) renice
C) priority
D) changeprio
View AnswerB
55. In Linux, what does the ‘export’ command do?
A) It sets environment variables
B) It imports variables from a file
C) It exports files to another system
D) It saves configurations
View AnswerA
56. What does the command ‘sudo reboot’ do in Linux?
A) It reboots the system with administrative privileges
B) It shuts down the system
C) It logs out the current user
D) It restarts a specific service
View AnswerA
57. Which command can be used to edit text files in the terminal?
A) nano
B) edit
C) vim
D) both A and C
View AnswerD
58. How do you display the contents of a compressed file without extracting it?
A) zcat
B) unzip -c
C) viewzip
D) less
View AnswerA
59. What is the function of the ‘crontab’ command?
A) To schedule periodic tasks
B) To create backups
C) To edit files
D) To manage system logs
View AnswerA
60. How do you create a new file in Linux using the command line?
A) touch
B) create
C) newfile
D) mkfile
View AnswerA
61. Which command is used to display the amount of free and used memory in the system?
A) meminfo
B) free
C) ramusage
D) checkmem
View AnswerB
62. In Linux, what does the ‘shutdown’ command do?
A) It powers off the system
B) It logs out the user
C) It restarts the graphical interface
D) It suspends the system
View AnswerA
63. What is the purpose of the ‘/tmp’ directory in Linux?
A) To store temporary files
B) To keep system logs
C) To contain user data
D) To save backups
View AnswerA
64. How can you redirect the output of a command to a file?
A) command > file.txt
B) command >> file.txt
C) command : file.txt
D) both A and B
View AnswerD
65. What command is used to update a system’s package list in Fedora?
A) apt update
B) yum update
C) dnf update
D) upgrade
View AnswerC
66. Which command is used to check the disk space usage of a file system?
A) df
B) du
C) spacecheck
D) diskusage
View AnswerA
67. What is the default file system used by most Linux distributions?
A) NTFS
B) ext4
C) FAT32
D) HFS+
View AnswerB
68. How can you search for a specific string in a file using the command line?
A) search
B) grep
C) find
D) locate
View AnswerB
69. What does the ‘chmod 644 filename’ command do?
A) Sets read/write for the owner and read for group and others
B) Sets execute permissions for everyone
C) Removes all permissions
D) Sets full permissions for the owner only
View AnswerA
70. In Linux, how can you view the system’s current uptime?
A) uptime
B) sysinfo
C) time
D) status
View AnswerA
71. What does the ‘ln’ command do in Linux?
A) Creates hard and symbolic links
B) Changes file permissions
C) Renames files
D) Copies files
View AnswerA
72. Which command would you use to see the first 20 lines of a file?
A) tail -n 20 file.txt
B) head -n 20 file.txt
C) display -n 20 file.txt
D) show -n 20 file.txt
View AnswerB
73. What does the ‘service’ command do in Linux?
A) Manages system services
B) Displays system information
C) Configures network settings
D) Manages user accounts
View AnswerA
74. In Linux, which command is used to create a compressed archive of files?
A) zip
B) tar
C) compress
D) archive
View AnswerB
75. What does the command ‘killall’ do in Linux?
A) Terminates all processes with a specific name
B) Stops the current process
C) Removes all files in a directory
D) Clears the terminal
View AnswerA
76. How do you find out the current kernel version in Linux?
A) kernel –version
B) uname -r
C) version
D) ver
View AnswerB
77. What command would you use to display the last 50 lines of a file?
A) tail -50 file.txt
B) last -50 file.txt
C) show -50 file.txt
D) display -n 50 file.txt
View AnswerA
78. Which command is used to install software in Ubuntu?
A) install
B) apt-get
C) setup
D) add
View AnswerB
79. In Linux, what is the purpose of the ‘/etc/fstab’ file?
A) To configure file systems
B) To store user account information
C) To list all installed packages
D) To manage services
View AnswerA
80. How do you change the password for a user in Linux?
A) passwd username
B) change username
C) modify username
D) usermod username
View AnswerA
81. What command is used to remove all files in a directory?
A) delete
B) rm -r *
C) rm *
D) clear
View AnswerB
82. What does the ‘dd’ command do in Linux?
A) Converts and copies files
B) Displays disk usage
C) Deletes files
D) Displays the content of a file
View AnswerA
83. Which command is used to configure network interfaces in Linux?
A) ifconfig
B) netconfig
C) ipconfig
D) networksetup
View AnswerA
84. What does the ‘shutdown -h now’ command do?
A) Halts the system immediately
B) Restarts the system
C) Powers off the system after 1 minute
D) Logs out the user
View AnswerA
85. How do you check which services are running on a Linux system?
A) service list
B) systemctl list
C) service –status
D) ps aux
View AnswerB
86. What is the purpose of the ‘iptables’ command?
A) To manage firewall rules
B) To configure network interfaces
C) To view current processes
D) To set user permissions
View AnswerA
87. Which file is used to configure user authentication in Linux?
A) /etc/passwd
B) /etc/shadow
C) /etc/login.defs
D) /etc/group
View AnswerB
88. How can you see detailed information about disk partitions in Linux?
A) df -h
B) lsblk
C) diskinfo
D) partinfo
View AnswerB
89. What is the purpose of the ‘hostname’ command?
A) To display or set the system’s hostname
B) To manage network settings
C) To view system uptime
D) To list users
View AnswerA
90. Which command is used to compare two files in Linux?
A) diff
B) compare
C) comp
D) match
View AnswerA
91. In Linux, how can you view the system’s hardware information?
A) sysinfo
B) lshw
C) hwinfo
D) hardwareinfo
View AnswerB
92. What does the ‘uname -a’ command display?
A) Kernel version and system information
B) Current username
C) Current directory
D) User account information
View AnswerA
93. How do you create a new user in Linux?
A) useradd username
B) newuser username
C) createuser username
D) adduser username
View AnswerA
94. Which command is used to check the integrity of a file system?
A) fsck
B) checkfs
C) verify
D) integritycheck
View AnswerA
95. What does the ‘free -m’ command display?
A) Memory usage in megabytes
B) Disk space usage
C) CPU information
D) Running processes
View AnswerA
96. In Linux, how do you display the contents of a file one screen at a time?
A) less
B) view
C) more
D) both A and C
View AnswerD
97. Which command is used to remove a non-empty directory?
A) rmdir
B) rm -r
C) deldir
D) delete
View AnswerB
98. What is the function of the ‘history’ command?
A) Displays the command history
B) Changes command history
C) Deletes old commands
D) Saves command history
View AnswerA
99. How do you check for open ports on a Linux system?
A) netstat
B) openports
C) ports
D) checkports
View AnswerA
100. What does the ‘mount’ command do?
A) Attaches a file system to the directory tree
B) Formats a disk
C) Lists current file systems
D) Copies files to another location
View AnswerA