You are on page 1of 14

Linux MCQ

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

You might also like