100 TOP Real Time Linux Multiple choice Questions & Answers

Read the most frequently asked 100 top Linux multiple choice questions and answers  for freshers and experienced

Linux Objective type Questions and Answers List

Linux Objective type Questions


What is the linux mascot?

A. Hat

B. Gecko

C. Elephant

D. Penguin

Ans: D


How do you show all processes being run by a particular user?

A. cat /home/USERNAME/open.process
B. top –USERNAME
C. cat /etc/activeprocess | grep USERNAME
D. netstat -u USERNAME
E. top -U [USERNAME]
Ans: E


What does GRUB stand for?

A. Grand Unified Bootloader

B. Grand Unification Bootloader

C. Great Unique Bootloader

D. Gum Removal Under Boot

E. Great Ultimate Bootloader

Ans: A


GRUB stands for _____.

A. Grand Unified Boot Loader

B. Gentoo’s Regular Booter

C. Great Unix Boot Loader

D. GNU Released Unix Booter

Ans: A


Mount -a’ will load all filesystems listed in:

A. /etc/mtab

B. /etc/filesystems

C. /etc/fstab

D. /etc/fs.conf

Ans: C


What is GNOME ?

A. A computer software system and network protocol that provides a basis for graphical user interfaces (GUIs) and rich input device capability for networked computers.

B. A desktop environment and graphical user interface that runs on top of a computer operating system.

C. A linux distribution

Ans: B


Ubuntu is based on…

A. Fedora

B. Slackware

C. Debian

D. None of these

E. Gentoo

Ans: C


How do you activate the noclobber shell option?

A. noclobber

B. set -o noclobber

C. #NAME?

Ans: B


The Linux Kernel was written by?

A. Brian Kernighan

B. Dennis Ritchie

C. Richard Stallman

D. Linus Torvalds

Ans: D


What will show you all the subdirectories of the current directory?

A. rm

B. ls

C. cd

D. cp

Ans: B


Which directory contains all the files needed to boot the Linux system?

A. /dev

B. /boot

C. /bin

Ans: B


‘mkfs’ is used to:

A. create a filesystem on a device (such as a hard disk partition)

B. format a floppy disk

C. create a fast changing section on a hard disk

D. create a named pipe (fifo) on a device

Ans: A


The ”rm” command is used to:

A. remove a kernel module owned by you

B. run an M4 macro

C. mount a remote file system

D. delete a file

Ans: D


What makes up a Linux kernel?

A. base kernel

B. kernel modules

C. all of these

Ans: C


What is the ssh command?

A. It is the standard shell: it has a restricted set of commands, but those are portable across different Linux distributions.

B. It is the synchronous shell: all commands are performed in real-time.

C. It is the secure shell; it is used to restrict actions available to users.

D. It is the secure shell; it is used to connect to remote hosts via an authenticated and encrypted channel.

E. It is the synchronous shell: all commands are performed in a synchrous way.

Ans: D


What does the pwd command do?

A. It saves the current working directory, so that you can return there with the popd command.

B. It asks the password of the current user, and the prompts for a new password.

C. It prints the path of the current working directory

D. It launches the power management daemon.

Ans: C


SSH stands for _____.

A. Security Shell

B. Synchronous Shell

C. System Shell

D. Secure Shell

E. Super Shell

Ans: D


mknod can create special file (used for sending or receiving data) of type:

A. character file

B. fifo (pipe) file

C. all are correct

D. block file

Ans: C


If you wanted to execute a shell command in the background, which character would you put at the end of the command line?

A. &

B. ;

C. :

Ans: A


The loaded modules in the kernel are listed in /proc/modules. You can get this list using the command:

A. lsmod

B. lsattr

C. listmodules

D. modules

Ans: A


Executing “pwd” in shell will return:

A. None of these

B. There is no such command

C. Your password

D. Current directory

Ans: D


_____ is a Linux “desktop environment”.

A. XFCe

B. Gnome

C. KDE

D. All of these

Ans: D


What does it means when the ps commands shows a ‘Z’ in the status column for a process?

A. The process is in sleep mode.

B. The process is running at top priority.

C. The process is a zombie process.

D. The process is running at low priority.

Ans: C


The netstat command give information on:

A. all are correct

B. active sockets

C. open sockets

D. routing tables

Ans: A


To repeat the last command in the bash shell history, type…

A. !!

B. $HISTFILE

C. !6

Ans: A


How do you view the documentation for the command ‘kill’ in the Linux terminal?

A. kill -help

B. kill –help

C. doc kill

D. cat /etc/docs/kill | less

E. man kill

Ans: E


What is swap?

A. Swap space is the area on a hard disk which is part of the Virtual Memory of your machine (Swap+RAM)

B. Swap is the cache of your HDD

C. Swap is the cache of your Physical Memory (RAM)

D. Swap is the ability to switch between users in one terminal session

Ans: A


Which answer assists you in finding help on the whois command?

A. help whois

B. man whois

C. none of these

D. man help whois

Ans: B


To start another shell under the current shell you use the command:

A. bash

B. All of these

C. sh

D. csh

Ans: B


To query DNS (Internet domain name) servers, you use the command:

A. dns

B. lsrouted

C. dnsquery

D. nslookup

Ans: D


Add this symbol to a command to run it in the background

A. &

B. *

C. 2

D. $

E. ?

Ans: A


What is the right command to save file and exit in Vim?

A. :wq

B. :a

C. :q

D. :q!

E. :w ‘file name’

Ans: A


Fedora Linux uses _____ packages.

A. deb

B. ebuild

C. deb_src

D. rpm

Ans: D


With which userspace is Linux typically paired?

A. Hurd

B. System V

C. GNU

D. BSD

E. Minix

Ans: C


As a privileged user, you may set the hostname with the command:

A. hostname

B. name

C. hn

D. host

Ans: A


What command can be used to delete a directory, recursively searching for files and other directories and deleting them?

A. rd

B. rmdir

C. rm -d

D. deltree

E. rm -r

Ans: E


On Red Hat Linux and its derivatives, which of the following commands will be appropriate to check whether a particular “package” is installed or not?

A. query-pkg

B. rpm -qa

C. pkg

D. sys

E. ls

Ans: B


To transfer files in an insecure way to and from a remote network site host, you use the command:

A. ftp

B. tcp

C. ucp

D. sftp

Ans: A


Which firewall is most commonly used on Linux?

A. ipchains

B. ipfw

C. pf

D. iptables

Ans: D


/etc/resolv.conf is …

A. Configuration file with local user accounts and its identificators

B. Network interfaces configuration file

C. The DNS resolver configuration file

D. Configuration file with software sources

E. This file does not exist

Ans: C


LILO…

A. is a boot loader that can boot Linux

B. stands for “Lannister-In-Lannister-Out”

C. is only used by Slackware

D. stands for “Light Loader”

E. is a type of Linux Distro

Ans: A


LVM is…

A. Logical Volume Manager

B. Linux Video Manager

C. Linux Volume Manager

D. Light Video Manager

Ans: A


uname -a will output…

A. kernel info

B. architecture

C. date where the kernel was built

D. cpu info

E. All of the answers are correct.

Ans: E


Consider using the command “cd /a/b/c”, then executing “cd ..”. What does this last command do?

A. changes to your home directory

B. displays the default directory path

C. prompts you for the next directory choice

D. changes to the / directory

E. changes to /a/b directory

Ans: E


Which tool is similar to find except that it uses an index to search?

A. locate

B. fastfind

C. search

Ans: A


To read one or more files and type them on standard output, you use:

A. ls

B. cat

C. type

D. biff

Ans: B


the ‘-r’ switch to the mount command will:

A. mount remote (network) filesystems

B. mount filesystem only after a read-write check is performed

C. mount removable (e.g., CD-ROM) filesystem

D. mount a filesystem as read-only

Ans: D


Which return value from an ioctl request indicates success?

A. ENOTTY

B. 0

C. EINVAL

D. EBADF

E. EFAULTF

Ans: B


The command “free” reports on:

A. memory

B. cpu

C. disk space

Ans: A


The jobs command

A. puts all foreground jobs in the background

B. lists background jobs

C. prints a dedication to Steve Jobs

D. provides basic accounting information for all current jobs

E. halts all foreground jobs

Ans: B


What does the Linux “no” command do?

A. Nothing; it doesn’t exist.

B. It’s the opposite of the “yes” command; it outputs an infinite series of ‘n’s (or a word of your choice).

C. It returns a non-zero exit code to indicate failure (it’s a synonym to the “false” command).

Ans: A


The command du -h ~

A. duplicates the current process

B. searches you home directory for duplicate filenames

C. deletes your account and home directory

D. lists the size of all files within your $HOME with sizes in human readable form

E. dumps your home directory to /tmp

Ans: D


Why hasn’t ZFS been added to the Linux kernel?

A. It’s too hard to port filesystems to Linux

B. Oracle is suing the Linux Foundation

C. Sun’s implementation uses a license incompatible with the GPL

D. There is a user space port using FUSE

Ans: C


What does “chmod 755 file” accomplish?

A. Makes the file read/write/execute by the owner, read/execute by group and other.

B. Makes the file execute by the owner, execute/read by group and other.

C. Makes the file write/execute by the owner, execute by group and other.

D. Makes the file read by the owner, execute by group and other.

E. Makes the file write/read by the owner, execute by group and other.

Ans: A


LILO is _____.

A. used for LIsting the boot LOaders

B. a boot loader

C. lists all the devices

D. lists all the lower memory areas

E. a type of Linux

Ans: B


What is a zombie process?

A. A zombie process is a process created by a worm to remain active even after it is killed.

B. A zombie process is a process which has terminated, but whose parent had not yet read its exit status.

C. A zombie process is a process whose status had been saved on the disk, and which is now waiting to be restored.

Ans: B


Which is an example of a shell comment?

A. mkdir text # make a directory

B. mkdir text //make a directory

C. //mkdir text

Ans: A


If a host is called HHH, ‘rstat HHH’ will:

A. show HHH uptime

B. show HHH load averages

C. all are correct

D. show HHH current time

Ans: C


Which of the following is not an editor?

A. expr

B. vi

C. emacs

D. ex

Ans: A


To use chown recursively, instead of using _recursive you can use:

A. #NAME?

B. -r

C. -c

D. -R

Ans: D


How would you create an alias for the cat command?

A. alias bkw=cat

B. You cannot do that.

C. ren bkw=cat

Ans: A


To access the value of an environment variable, we _____.

A. add the dollar ($) symbol before the variable name

B. type the variable’s name (in lower case only)

C. add the hash (#) symbol after the variable name

D. add the dollar ($) symbol after the variable name

E. add the underscore (_) symbol before the variable name

Ans: A


How to reveal detailed information about CPU?

A. sysinfo –cpu

B. cpusage

C. dmesg

D. cat /proc/cpuinfo

Ans: D


_____ command starts the default desktop environment.

A. gdm

B. xterm

C. startx

D. gdm-start

E. gnome-terminal

Ans: C


You want to load the main kernel module for USB support. Which command would help you achieve this task?

A. modprobe usbcore

B. modprobe ehci-ocd

C. modprobe uhci-hcd

Ans: A


If DDD is a non empty directory, and you execute ‘rmdir DDD’, it will:

A. move the contents of DDD to /tmp, and delete the DDD directory

B. delete only the contents of the DDD directory

C. produce an error

D. delete both the contents of and the DDD directory

Ans: C


lsof command means:

A. Large Scale Optimization File

B. List Open Files

C. Local System Officer

D. Local Service of Files

E. Lag Spike of Death

Ans: B


Which of the following accurately describes a “ping?”

A. sends ICMP packets to target device/server to verify if it’s online.

B. makes an audiable ping each time a disk drive start spinning

C. verifies that the routing tables comply to the current network state

D. sends TCP packets to target device/server to verify if it’s online.

Ans: A


What is the maximum length of a file name on Linux?

A. 255 bytes.

B. 1023 bytes.

C. It depends on the file system.

D. 1024 bytes.

E. 256 bytes.

Ans: C


The run level in a system can be configured in the file _____.

A. /bin/runlev

B. /sys/rinit

C. /bin/rlev

D. /etc/inittab

E. /etc/syslev

Ans: D


When does /tmp normally get cleaned out?

A. Never; it has to be manually cleaned.

B. Every time the system is booted.

C. Every week (run by /etc/cron.weekly).

D. Every month (run by /etc/cron.monthly).

Ans: B


To report the amount of free disk space available on all mounted file systems you use the command:

A. free

B. fs

C. du

D. df

Ans: D


In a date +format, you add the hour in 24 hours format using:

A. %f

B. %H

C. %F

D. %h

Ans: B


What does the “uname” command do?

A. nothing

B. print system information

C. show the user name

D. change user name

Ans: B


If you use the rm command to accidentally delete a file, how can you get the file back?

A. You cannot get the file back.

B. Go to the trash bin and remove it.

C. Type the rm -u command.

Ans: A


The behavior of the system for each “runlevel” is available in the _____ file.

A. /etc/mtab

B. /etc/inittab

C. /etc/hosts

D. /etc/rlevel

E. /etc/crontab

Ans: B


command1 | command2 will?

A. Command1 and Command2 run together

B. Output command2 wil be input of command1

C. Output command1 wil be input of command2

D. Command2 run after Command1

Ans: C


printenv will:

A. print a text file to the printer specified in /etc/env

B. print a text file to the printer specified in $PRINTER

C. type values of environment variables

D. print a text file to the default printer

Ans: C


Is it possible to increase SWAP space without rebooting?

A. No, you have to boot with a Live CD to do that

B. No, you have to reboot for the new swap to be activated properly

C. No, you have to re-install your system to do that

D. Yes if you create a swap file

Ans: D


To print the first 10 lines of one or more files to the standard output, you use the command:

A. topf

B. head

C. ftop

D. start

Ans: B


What flag makes “ls -l” print file sizes in human readable format (e.g. 1K, 231M, 2G, etc)?

A. -f

B. -r

C. -H

D. -h

Ans: D


True or false: The Linux OS is not affected by malware.

A. True

B. False

Ans: B


Which Run Level provides “Full multiuser mode with network and X display manager”?

A. Run Level 4

B. Run Level 5

C. Run Level 1

D. Run Level 3

E. Run Level 2

Ans: B


To create one or more directories with the mkdir command, which permissions in the directory’s parent directory do you need?

A. create

B. write

C. execute

D. read

Ans: B


To display contents of files on standard output, you could use the command:

A. All of these

B. cat

C. more

D. less

Ans: A


The at command allows you to execute a command at:

A. a certain machine

B. a certain holiday

C. a certain date

D. a certain network

Ans: C


In a ps command output, the PPID displays the:

A. Number of memory pages (swap) of the process

B. Process’s scheduling priority

C. Process ID

D. Parent process ID

Ans: D


‘mv -f’ will:

A. even if the target file exists, the operation will be carried out (and no warning messages on restricted access modes will be printed)

B. move the file to the filesystem indicated after the ‘-f’ switch

C. will move the file in a fast mode, namely will not make any checks (like if there’s enough space for the file)

D. will move the file or directory to a FIFO device

Ans: A


_____ is not a ‘Terminal Emulator’.

A. konsole

B. xterm

C. gnome-terminal

D. gdm

Ans: D


How do you redirect stderr to stdout?

A. Using >>stderr

B. Using 2>&1

C. Using >/dev/error

Ans: B


What, according to bc, is 2^2?

A. 4.00000001

B. 4

C. 2

D. A syntax error.

Ans: B


Typing the “cd” command at the shell prompt will take you to the _____.

A. /root

B. parent

C. current

D. $HOME

E. /boot

Ans: D


modinfo [options] ofile’ will:

A. create a help file for kernel module ofile

B. print information about kernel module ofile

C. set information about kernel module ofile

D. set default handling options for kernel module ofile

Ans: B


modprobe…

A. types the header section of the specified module

B. searches all filesystems for the specified module

C. searches memory to see if the specified module is loaded to memory

D. attempts to load a kernel module along with all its depended modules

Ans: D


Which of the following file ‘probably’ contains the ‘user specific’ settings for the “windows manager”?

A. /X11/xinit/xinitrc

B. $HOME/.xinitrc

C. /xinit/xinitrc

D. /.xinitrc

E. /etc/X11/xinit/xinitrc

Ans: B


To search one or more files for matching lines, which command may be used?

A. grep

B. egrep

C. fgrep

D. All of these

Ans: D


What does the $ represent within the context of a shell command?

A. The string after the $ is replaced by a directory name.

B. all of these

C. The string after the $ will take on the value of the environment variable with the same name.

Ans: C


Write a command to list all files with 5 characters in the name.

A. ls !!!!!

B. ls ?????

C. ls *****

Ans: B


The mkraid command will:

A. separate the disk devices into two groups and will create RAID 1/0 on them

B. initialize a new RAID array, destroying any existing data on the disks used

C. move any data on the disk devices used to create the array into the new RAID

D. create a new RAID 5 on the disk devices

Ans: B


Single User Mode equivalent to _____.

A. run level 4

B. run level 1

C. run level 3

D. run level 2

E. run level 0

Ans: B


What binary format do Linux Executables use?

A. PE

B. ELF

C. Mach-O

D. a.out

E. COFF

Ans: B


To see the kernel routing tables, you do:

A. route or netstat -r

B. routing

C. route -w

D. cat /etc/routetab

Ans: A


What is “vmlinuz”?

A. It is a “virtual machine” used in Linux.

B. It is a “type of Linux Shell”.

C. This command executes Linux in “virtual mode”.

D. It is a “compressed Linux kernel”.

E. It is a “type of Linux operating system”.

Ans: D


What is the uid of root?

A. -1

B. 0

C. superuser

D. 1000

E. 1

Ans: B


pwconv will…

A. convert /etc/passwd file so non previleged users could edit it

B. revert the system to use unshadowed passwords

C. convert entries in /etc/passwd (un-shadowed) into shadowed entries in /etc/shadow

D. convert /etc/passwd entries from Unix to Linux format

Ans: C


SSH uses _____ to authenticate remote computers.

A. public key cryptography

B. secret key cryptography

C. both block and stream ciphers

D. stream cipher

E. block cipher

Ans: A


By default what file contains encrypted user passwords?

A. /etc/password

B. /etc/master.passwd

C. /etc/passwd

D. /etc/shadow

E. /etc/passwdinfo

Ans: D


‘mkdir -m 444 any’ will:

A. Create a read-write-execute directory named any

B. create a read-only directory named any

C. Create a write-only directory named any

D. Create a read-write directory named any

Ans: B


What program is launched by the kernel at system start up first?

A. /sbin/start

B. /boot

C. /sbin/initial

D. /sbin/init

E. /etc/rc.d/rc.sysinit

Ans: D


How do you make a list of all filenames in the /tmp directory that the contain the text “user”, regardless of case?

A. ls /tmp : grep user

B. ls /tmp | grep user

C. ls /tmp | grep -i user

D. grep user /tmp

E. ls /tmp | find user

Ans: C


rev will:

A. reverse the order of characters read from standard input and type the result stream of characters to standard output

B. reverse the spin of a local disk drive

C. review the networking status and alert on problems

D. type the system revision number to standard output

Ans: A


Can I have swap partition and swap file activated at the same time?

A. Yes

B. No

C. Only if you set ‘vm.swa