Computer

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

Answer
d) Bash shell

Which of the following Linux commands is used to list files and directories?
a) ls
b) pwd
c) cd
d) mkdir

Answer
a) ls

Which Linux command is used to display the current working directory?
a) pwd
b) ls
c) cd
d) mkdir

Answer
a) pwd

What is the package manager used in Debian-based Linux distributions?
a) apt
b) yum
c) zypper
d) pacman

Answer
a) apt

Which command in Linux is used to change the file permissions?
a) chmod
b) chown
c) ls
d) mkdir

Answer
a) chmod

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

Answer
b) Searches text using patterns

Which Linux command is used to display the manual for a command?
a) man
b) help
c) info
d) guide

Answer
a) man

Which of the following commands is used to view the contents of a file in Linux?
a) ls
b) cat
c) mv
d) rm

Answer
b) cat

Which of the following file systems is commonly used in Linux?
a) NTFS
b) ext4
c) FAT32
d) HFS+

Answer
b) ext4

What is the default directory for user files in Linux?
a) /usr
b) /home
c) /bin
d) /etc

Answer
b) /home

Which command in Linux is used to create a new directory?
a) rmdir
b) mkdir
c) touch
d) mv

Answer
b) mkdir

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

Answer
b) To change file permissions

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

Answer
b) Display free disk space

Which of the following is a Linux-based operating system?
a) Windows XP
b) Ubuntu
c) macOS
d) FreeBSD

Answer
b) Ubuntu

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

Answer
c) The core part of the operating system

Which command is used in UNIX/Linux to change the file owner?
a) chown
b) chmod
c) ls
d) mv

Answer
a) chown

What is the default text editor in most Linux distributions?
a) Nano
b) Emacs
c) Vim
d) Notepad

Answer
c) Vim

Which of the following commands is used to view running processes in Linux?
a) ps
b) cat
c) ls
d) kill

Answer
a) ps

In Linux, which command is used to copy files and directories?
a) mv
b) cp
c) rm
d) mkdir

Answer
b) cp

Which file extension is commonly used for shell scripts in UNIX/Linux?
a) .exe
b) .sh
c) .txt
d) .bin

Answer
b) .sh

Which of the following is a common UNIX shell?
a) CMD
b) Bash
c) PowerShell
d) Command Prompt

Answer
b) Bash

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

Answer
a) List directory contents

What is the root directory in a Linux/UNIX file system denoted by?
a) /
b) /home
c) /usr
d) /bin

Answer
a) /

Which of the following commands is used to delete a file in Linux/UNIX?
a) rm
b) rmdir
c) del
d) erase

Answer
a) rm

What does the “uptime” command show in Linux/UNIX?
a) System boot time
b) Running processes
c) System resource usage
d) System uptime

Answer
d) System uptime

Which file system is commonly used in UNIX?
a) FAT32
b) ext4
c) UFS
d) NTFS

Answer
c) UFS

Which of the following Linux distributions is known for being user-friendly?
a) Arch Linux
b) Fedora
c) Ubuntu
d) Debian

Answer
c) Ubuntu

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

Answer
b) To terminate 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

Answer
a) Change file permissions

Which command is used in Linux to find files based on name or other attributes?
a) locate
b) find
c) search
d) dir

Answer
b) find

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

Answer
a) It grants temporary root privileges

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

Answer
c) GNOME

Which of the following commands is used to compress files in Linux?
a) unzip
b) zip
c) tar
d) gzip

Answer
d) gzip

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button