Computer Fundamentals MCQ – Linux

Here’s a set of 25 Multiple Choice Questions (MCQs) on Linux OS along with answers and explanations. These questions cover fundamental concepts, commands, file systems, permissions, and more.


Linux OS MCQs (With Answers & Explanations)

1. What is the core of the Linux operating system called?

a) Shell
b) Kernel
c) Terminal
d) GUI

Answer: b) Kernel
Explanation: The kernel is the core component of Linux, managing hardware resources and system processes.


2. Which command is used to list files and directories in Linux?

a) ls
b) dir
c) list
d) show

Answer: a) ls
Explanation: The ls command lists files and directories in the current directory.


3. What does the cd command do?

a) Creates a directory
b) Changes the current directory
c) Copies files
d) Deletes a directory

Answer: b) Changes the current directory
Explanation: cd stands for “change directory” and is used to navigate between folders.


4. Which command is used to display the current working directory?

a) pwd
b) cwd
c) where
d) dir

Answer: a) pwd
Explanation: pwd (Print Working Directory) shows the full path of the current directory.


5. How do you create a new directory in Linux?

a) mkdir
b) newdir
c) createdir
d) dir

Answer: a) mkdir
Explanation: mkdir (Make Directory) creates a new directory.


6. Which command removes a file in Linux?

a) del
b) rm
c) remove
d) erase

Answer: b) rm
Explanation: The rm (remove) command deletes files.


7. What does chmod 755 filename do?

a) Gives read, write, execute to owner, and read & execute to group/others
b) Gives full permissions to everyone
c) Makes the file hidden
d) Locks the file

Answer: a) Gives read, write, execute to owner, and read & execute to group/others
Explanation: 755 means:

  • Owner (7): Read (4) + Write (2) + Execute (1)
  • Group (5): Read (4) + Execute (1)
  • Others (5): Read (4) + Execute (1)

8. Which command displays the manual page of a command?

a) help
b) info
c) man
d) doc

Answer: c) man
Explanation: The man (manual) command provides documentation for Linux commands.


9. What is the default shell in most Linux distributions?

a) Bash
b) Zsh
c) Fish
d) Ksh

Answer: a) Bash
Explanation: Bash (Bourne Again Shell) is the default shell in most Linux systems.


10. Which command is used to search for text within files?

a) find
b) search
c) grep
d) locate

Answer: c) grep
Explanation: grep (Global Regular Expression Print) searches for text patterns in files.


11. What does the sudo command do?

a) Switches user
b) Runs a command as root/superuser
c) Shuts down the system
d) Lists system users

Answer: b) Runs a command as root/superuser
Explanation: sudo (SuperUser DO) allows permitted users to execute commands as root.


12. Which file stores user passwords in Linux?

a) /etc/passwd
b) /etc/shadow
c) /etc/group
d) /etc/users

Answer: b) /etc/shadow
Explanation: /etc/shadow stores encrypted user passwords securely.


13. How do you terminate a running process in Linux?

a) stop
b) kill
c) end
d) terminate

Answer: b) kill
Explanation: The kill command terminates processes using their PID (Process ID).


14. Which command displays system information like kernel version?

a) sysinfo
b) uname -a
c) linuxinfo
d) systeminfo

Answer: b) uname -a
Explanation: uname -a shows system details, including kernel version.


15. What is the purpose of the tar command?

a) Manage users
b) Archive files
c) Edit text
d) Monitor network

Answer: b) Archive files
Explanation: tar (Tape Archive) is used to create/extract compressed archive files.


16. Which command shows disk usage in Linux?

a) diskusage
b) df
c) du
d) Both df and du

Answer: d) Both df and du
Explanation:

  • df (Disk Free) shows disk space usage.
  • du (Disk Usage) shows file/directory space usage.

17. How do you rename a file in Linux?

a) rename
b) mv
c) cp
d) rn

Answer: b) mv
Explanation: The mv (move) command renames files (e.g., mv oldname newname).


18. What does >> do in Linux?

a) Overwrites a file
b) Appends to a file
c) Redirects output
d) Displays file content

Answer: b) Appends to a file
Explanation: >> appends output to a file, while > overwrites it.


19. Which command checks network connectivity?

a) netstat
b) ping
c) ifconfig
d) traceroute

Answer: b) ping
Explanation: ping tests connectivity between two network devices.


20. What is the root user’s UID in Linux?

a) 0
b) 1
c) 100
d) 500

Answer: a) 0
Explanation: The root user has UID 0, the highest privilege level.


21. Which command displays running processes?

a) ps
b) top
c) htop
d) All of the above

Answer: d) All of the above


22. What is the purpose of chown?

a) Change file permissions
b) Change file ownership
c) Change file timestamps
d) Change file size

Answer: b) Change file ownership


23. Which file is executed at user login in Bash?

a) ~/.bashrc
b) ~/.bash_profile
c) /etc/profile
d) All of the above

Answer: d) All of the above


24. How do you schedule tasks in Linux?

a) cron
b) at
c) sleep
d) Both a and b

Answer: d) Both a and b


25. What does umask do?

a) Sets default file permissions
b) Changes user passwords
c) Lists mounted devices
d) Manages swap space

Answer: a) Sets default file permissions


Conclusion

These 25 Linux MCQs cover essential commands, file systems, permissions, and system administration concepts. They are useful for interviews, exams, and certifications like CompTIA Linux+, RHCSA, and LPIC.