Linux MCQs

Linux MCQs

These Linux multiple-choice questions and their answers will help you strengthen your grip on the subject of Linux. You can prepare for an upcoming exam or job interview with these Linux MCQs.
So scroll down and start answering.

1: What is the linux mascot?

A.   Penguin

B.   Gecko

C.   Elephant

D.   Hat

2: What will you get if you try to read from the pseudo-device /dev/null?

A.   Nothing.

B.   An error (/dev/null can only be written to, not read from).

C.   An infinite string of zeroes ('0', ASCII 0x30).

D.   An infinite string of nulls ('\0', ASCII 0x00).

3: What does the following line mean when it is run in a script '#!/bin/bash'?

A.   It checks to see if the bash shell exists on the machine.

B.   It makes sure that the script runs in the bash shell.

C.   all of these

4: By default what file contains encrypted user passwords?

A.   /etc/passwd

B.   /etc/master.passwd

C.   /etc/shadow

D.   /etc/passwdinfo

E.   /etc/password

5: The at command allows you to execute a command at:

A.   a certain machine

B.   a certain date

C.   a certain network

D.   a certain holiday

6: What does GRUB stand for?

A.   Grand Unified Bootloader

B.   Gum Removal Under Boot

C.   Great Ultimate Bootloader

D.   Great Unique Bootloader

E.   Grand Unification Bootloader

7: The jobs command

A.   lists background jobs

B.   provides basic accounting information for all current jobs

C.   halts all foreground jobs

D.   prints a dedication to Steve Jobs

E.   puts all foreground jobs in the background

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

A.   -c

B.   #NAME?

C.   -r

D.   -R

9: Which is an example of a shell comment?

A.   //mkdir text

B.   mkdir text # make a directory

C.   mkdir text //make a directory

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

A.   /bin/runlev

B.   /etc/inittab

C.   /bin/rlev

D.   /sys/rinit

E.   /etc/syslev

11: The behavior of the system for each "runlevel" is available in the _____ file.

A.   /etc/rlevel

B.   /etc/hosts

C.   /etc/mtab

D.   /etc/crontab

E.   /etc/inittab

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

A.   topf

B.   start

C.   head

D.   ftop

13: uname -a will output...

A.   date where the kernel was built

B.   cpu info

C.   All of the answers are correct.

D.   kernel info

E.   architecture

14: what makes the command cd ../../

A.   nothing

B.   moves the root home directory

C.   moves the current home directory

D.   Traverse two directories up the directory tree.

E.   wil be error

15: With which userspace is Linux typically paired?

A.   Minix

B.   System V

C.   Hurd

D.   GNU

E.   BSD

16: The netstat command give information on:

A.   routing tables

B.   all are correct

C.   active sockets

D.   open sockets

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

A.   bash

B.   sh

C.   All of these

D.   csh

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

A.   modules

B.   lsattr

C.   lsmod

D.   listmodules

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

A.   all are correct

B.   character file

C.   fifo (pipe) file

D.   block file

20: SSH stands for _____.

A.   Security Shell

B.   Synchronous Shell

C.   Secure Shell

D.   Super Shell

E.   System Shell

21: 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.   :

22: What is the ssh command?

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

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

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

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

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

23: What does the pwd command do?

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

B.   It launches the power management daemon.

C.   It prints the path of the current working directory

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

24: what the command "cd .." do

A.   move to root directory

B.   move to home directory

C.   nothing

D.   one level up from the current directory

25: The Linux Kernel was written by?

A.   Richard Stallman

B.   Brian Kernighan

C.   Linus Torvalds

D.   Dennis Ritchie

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

A.   rm

B.   cd

C.   cp

D.   ls

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

A.   /boot

B.   /bin

C.   /dev

28: What makes up a Linux kernel?

A.   kernel modules

B.   base kernel

C.   all of these

29: 'mkfs' is used to:

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

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

C.   create a fast changing section on a hard disk

D.   format a floppy disk

30: How do you activate the noclobber shell option?

A.   set -o noclobber

B.   noclobber

C.   #NAME?

31: Executing "pwd" in shell will return:

A.   None of these

B.   Your password

C.   There is no such command

D.   Current directory

32: Fedora Linux uses _____ packages.

A.   deb_src

B.   rpm

C.   deb

D.   ebuild

33: Ubuntu is based on...

A.   None of these

B.   Slackware

C.   Gentoo

D.   Debian

E.   Fedora

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

A.   nslookup

B.   dns

C.   lsrouted

D.   dnsquery

35: _____ is a Linux "desktop environment".

A.   All of these

B.   XFCe

C.   Gnome

D.   KDE

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

A.   :q!

B.   :w 'file name'

C.   :q

D.   :a

E.   :wq

37: Which firewall is most commonly used on Linux?

A.   iptables

B.   ipfw

C.   ipchains

D.   pf

38: what the "cd /" command do?

A.   The directory one level up from the current directory

B.   Listing all LISTENING Connections

C.   Change into the root directory

39: 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 linux distribution

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

40: What does it means when the ps commands shows a 'Z' in the status column for a process?

A.   The process is running at low priority.

B.   The process is a zombie process.

C.   The process is in sleep mode.

D.   The process is running at top priority.

41: To repeat the last command in the bash shell history, type...

A.   $HISTFILE

B.   !6

C.   !!

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

A.   man whois

B.   none of these

C.   help whois

D.   man help whois

43: What is swap?

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

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

C.   Swap is the cache of your HDD

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

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

A.   host

B.   name

C.   hn

D.   hostname

45: LILO...

A.   stands for "Light Loader"

B.   is a type of Linux Distro

C.   is a boot loader that can boot Linux

D.   stands for "Lannister-In-Lannister-Out"

E.   is only used by Slackware

46: How do you view the documentation for the command 'kill' in the Linux terminal?

A.   cat /etc/docs/kill | less

B.   kill --help

C.   man kill

D.   doc kill

E.   kill -help

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

A.   2

B.   $

C.   *

D.   &

E.   ?

48: 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.   ls

B.   sys

C.   pkg

D.   query-pkg

E.   rpm -qa

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

A.   type

B.   cat

C.   biff

D.   ls

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

A.   rm -d

B.   rd

C.   deltree

D.   rmdir

E.   rm -r