Linux & UNIX Operating Systems MCQs with Answers
What is the default shell in most Linux distributions?
a) C shell
b) Bourne shell
c) Z shell
d) Bash shell
Which of the following Linux commands is used to list files and directories?
a) ls
b) pwd
c) cd
d) mkdir
Which Linux command is used to display the current working directory?
a) pwd
b) ls
c) cd
d) mkdir
What is the package manager used in Debian-based Linux distributions?
a) apt
b) yum
c) zypper
d) pacman
Which command in Linux is used to change the file permissions?
a) chmod
b) chown
c) ls
d) mkdir
What does the “grep” command do in Linux?
a) Removes files
b) Searches text using patterns
c) Changes directory
d) Lists files in a directory
Which Linux command is used to display the manual for a command?
a) man
b) help
c) info
d) guide
Which of the following commands is used to view the contents of a file in Linux?
a) ls
b) cat
c) mv
d) rm
Which of the following file systems is commonly used in Linux?
a) NTFS
b) ext4
c) FAT32
d) HFS+
What is the default directory for user files in Linux?
a) /usr
b) /home
c) /bin
d) /etc
Which command in Linux is used to create a new directory?
a) rmdir
b) mkdir
c) touch
d) mv
In UNIX, what is the purpose of the “chmod” command?
a) To change the file owner
b) To change file permissions
c) To move files
d) To copy files
What does the “df” command do in Linux?
a) Display file contents
b) Display free disk space
c) Change file permissions
d) Display system information
Which of the following is a Linux-based operating system?
a) Windows XP
b) Ubuntu
c) macOS
d) FreeBSD
What is the kernel in a Linux or UNIX system?
a) A system utility
b) A device driver
c) The core part of the operating system
d) A file manager
Which command is used in UNIX/Linux to change the file owner?
a) chown
b) chmod
c) ls
d) mv
What is the default text editor in most Linux distributions?
a) Nano
b) Emacs
c) Vim
d) Notepad
Which of the following commands is used to view running processes in Linux?
a) ps
b) cat
c) ls
d) kill
In Linux, which command is used to copy files and directories?
a) mv
b) cp
c) rm
d) mkdir
Which file extension is commonly used for shell scripts in UNIX/Linux?
a) .exe
b) .sh
c) .txt
d) .bin
Which of the following is a common UNIX shell?
a) CMD
b) Bash
c) PowerShell
d) Command Prompt
What is the primary function of the “ls” command in Linux?
a) List directory contents
b) List files in order
c) Change directory
d) List user names
What is the root directory in a Linux/UNIX file system denoted by?
a) /
b) /home
c) /usr
d) /bin
Which of the following commands is used to delete a file in Linux/UNIX?
a) rm
b) rmdir
c) del
d) erase
What does the “uptime” command show in Linux/UNIX?
a) System boot time
b) Running processes
c) System resource usage
d) System uptime
Which file system is commonly used in UNIX?
a) FAT32
b) ext4
c) UFS
d) NTFS
Which of the following Linux distributions is known for being user-friendly?
a) Arch Linux
b) Fedora
c) Ubuntu
d) Debian
What is the purpose of the “kill” command in Linux/UNIX?
a) To delete files
b) To terminate processes
c) To create directories
d) To start new processes
Which of the following is a common use of the “chmod” command?
a) Change file permissions
b) Change file name
c) Change file location
d) Change file owner
Which command is used in Linux to find files based on name or other attributes?
a) locate
b) find
c) search
d) dir
Which of the following is true about the “sudo” command in Linux?
a) It grants temporary root privileges
b) It is used to create users
c) It is used to change file ownership
d) It deletes files securely
What is the common name of the graphical user interface in Linux distributions like Ubuntu?
a) X Window System
b) Wayland
c) GNOME
d) KDE
Which of the following commands is used to compress files in Linux?
a) unzip
b) zip
c) tar
d) gzip