Test your general knowledge of linux. Answers, with full explainations, are at the end. More practice questions can be found here. Enjoy .

QUESTIONS

----------------------------------------------------------------------------
Question 1

What type of local file server can you use to provide the distribution
installation materials to the new machine during a network installation?

A) Inetd
B) FSSTND
C) DNS
D) NNTP
E) NFS

----------------------------------------------------------------------------
Question 2

Which partitioning tool is available in all distributions?

A) Disk Druid
B) fdisk
C) Partition Magic
D) FAT32
E) System Commander

----------------------------------------------------------------------------
Question 3

Which of the following are X-based system configuration tools available in
some distributions? [Choose all correct answers]

A) COAS
B) KConf
C) Linuxconf
D) Yast
E) GnoConf

----------------------------------------------------------------------------
Question 4

Which first-level segment of the file system contains a majority of system
and server configuration files within its subdirectories?

A) /var
B) /etc
C) /bin
D) /sbin
E) /lib

----------------------------------------------------------------------------
Question 5

Which file do you edit to set partitions to mount at boot time?

A) /etc/fstab
B) /etc/services
C) /etc/smb.conf
D) /etc/fstab.conf
E) /etc/mount.conf

----------------------------------------------------------------------------
Question 6

Which file do you edit to set up a printer?

A) /etc/printtab.conf
B) /etc/print.conf
C) /etc/lp.conf
D) /etc/printtab
E) /etc/printers

----------------------------------------------------------------------------
Question 7

Which of the following sequences results in the output of the ls command
being mailed to the recipient?

A) ls > mail bob
B) ls | mail bob
C) ls < mail bob
D) ls >> mail box
E) ls || mail bob

----------------------------------------------------------------------------
Question 8

What do you type to join the text contents of the files "start" and "end"
into the file "whole"?

A) join start end > whole
B) cat start end > whole
C) join start end whole
D) cat start end whole
E) merge start end whole

----------------------------------------------------------------------------
Question 9

Which of the following commands can you use to search within the file system
by file names? [Choose all correct answers]

A) locate
B) which
C) where
D) look
E) find

----------------------------------------------------------------------------
Question 10

Which of the following sequences results in the output of the who command
being saved to the file whonow?

A) who | whonow
B) who < whonow
C) who > whonow
D) who -> whonow
E) who whonow

----------------------------------------------------------------------------
Question 11

Which command tells you what partitions and devices are mounted onto the
file system?

A) mount
B) fstab
C) fs
D) mount -l
E) df

----------------------------------------------------------------------------
Question 12

What would you type to send the last 20 lines of a text file to STDIN?

A) end -n 20 filename
B) last -n 20 filename
C) head -20 filename
D) end -20 filename
E) tail -20 filename

----------------------------------------------------------------------------
Question 13

Which two commands can you use to delete directories?

A) rm
B) rm -rf
C) rmdir
D) rd
E) rd -rf

----------------------------------------------------------------------------
Question 14

Which command do you use to change runlevels?

A) initlevel
B) runlevel
C) level
D) run
E) init

----------------------------------------------------------------------------
Question 15

What do you type to stop a hung process that resists the standard attempts
to shut it down? [Choose all correct answers]

A) kill PID
B) quit
C) kill -9 PID
D) exit
E) Ctrl+C

----------------------------------------------------------------------------
Question 16

Which of the following commands can you use to cleanly restart a Linux
machine? [Choose all correct answers]

A) reboot
B) init 6
C) init 0
D) shutdown -r
E) shutdown -h

----------------------------------------------------------------------------
Question 17

What command would you use to create an empty file without opening it to
edit it?

A) open
B) vi
C) pico
D) touch
E) edit

----------------------------------------------------------------------------
Question 18

Which shell do you assign to a POP3 mail-only account?

A) /bin/false
B) /bin/sh
C) /bin/bash
D) /bin/pop
E) /bin/pop3

----------------------------------------------------------------------------
Question 19

Which of the following contrasts and comparisons about the services in
questions 28 and 29 are true? [Choose all correct answers]

A) 28 does file locking, 29 does not.
B) Both 28 and 29 can be used on a multi-OS LAN to serve files to all
machines.
C) 29 does file locking, 28 does not.
D) Both 28 and 29 have special file system types for mount purposes.
E) 29 has a special file system type for mounting, but 28 does not.

----------------------------------------------------------------------------
Question 20

Which mail service controls mail pick-up but is not in itself the server
that controls dissemination across the network?

A) sendmail
B) pop3
C) inetd
D) smail
E) qmail
----------------------------------------------------------------------------

ANSWERS

----------------------------------------------------------------------------
Question 1

E) NFS

Explanation:

Answer e is correct. You can use an NFS server to provide the distribution
installation materials to the machine on which you are performing the
installation.

Answers a, b, c, and d are all valid items but none of them are file
servers. Inetd is the superdaemon which controls all intermittently used
network services. The FSSTND is the Linux File System Standard. DNS provides
domain name resolution, and NNTP is the transfer protocol for usenet news.

----------------------------------------------------------------------------
Question 2

B) fdisk

Explanation:

Answer b is correct. The fdisk partitioning tool is available in all Linux
distributions.

Answers a, c, and e all handle partitioning, but do not come with all
distributions. Disk Druid is made by Red Hat and used in its distribution
along with some derivatives. Partition Magic and System Commander are tools
made by third-party companies. Answer d is not a tool, but a file system
type. Specifically, FAT32 is the file system type used in Windows 98.

----------------------------------------------------------------------------
Question 3

A) COAS
C) Linuxconf
D) Yast

Explanation:

Answers a, c, and d are correct. GUI-based configuration tools available in
some distributions are COAS, Linuxconf, and Yast.

Answers b and e are not valid tools.

----------------------------------------------------------------------------
Question 4

B) /etc

Explanation:

Answer b is correct. The /etc portion of the file system contains a number
of system and daemon configuration files.

Answers a, c, d, and e are valid first-level directories, but are incorrect.
The /var directory contains items that change on a regular basis, such as
log files and print and mail spool directories. The /bin directory contains
system binaries, whereas the /sbin directory contains binaries that run with
SUID privileges or as a specific user. The /lib directory contains system
libraries, both shared and non-shared.

----------------------------------------------------------------------------
Question 5

A) /etc/fstab

Explanation:

Answer a is correct. The file /etc/fstab manages which partitions are
automatically mounted onto the file system.

Answers b and c refer to valid items, but they are not used to manage the
file system. The file /etc/services maps networking services to the ports
they utilize, and /etc/smb.conf is the configuration file for the Samba
service. Answers d and e point to files that do not exist.

----------------------------------------------------------------------------
Question 6

D) /etc/printtab

Explanation:

Answer d is correct. The file /etc/printab contains printer configuration
information.

Answers a, b, c, and e point to files that do not exist.

----------------------------------------------------------------------------
Question 7

B) ls | mail bob

Explanation:

Answer b is correct. The ls command is run, and then the results are piped
to the mail program, which sends them to bob. Answers a, c, and d generate
errors. Answer e displays the output of the ls command.

----------------------------------------------------------------------------
Question 8

B) cat start end > whole

Explanation:

Answer b is correct. To join these two files, you would use the command cat
start end > whole.

Answers a, c, d, and e all use valid commands, but not necessarily valid
syntax. Also, the commands do not do what is required by the question. The
join command exists in the ex editor, and is used to join individual lines
of text. This command does not use redirection in its syntax, nor does it
use file names. The cat command, however, requires a redirection unless you
want the output to go to STDOUT, which is the screen. Finally, the merge
com-mand is used to combine two files that are slightly different,
incorporating the sum total of what is there. It does not simply tack the
files together like the cat command does.

----------------------------------------------------------------------------
Question 9

A) locate
B) which
E) find

Explanation:

Answers a, b, and e are correct. The three search tools that look at file
names are find, locate, and which. Answer c is not a command, except in
specifically one shell (tcsh). Answer d is a command, but not a file system
search command. The look command is used to search the contents of text
files.

----------------------------------------------------------------------------
Question 10

C) who > whonow

Explanation:

Answer c is correct. The who command is run, and the results are saved to
the file whonow. Answers a and b generate errors. Answers d and e generate
nothing.

----------------------------------------------------------------------------
Question 11

E) df

Explanation:

Answer e is correct. The df command lists the devices and partitions that
are mounted onto the file system. Answers a and d refer to a valid command,
though there is no -l flag for mount. However, the mount command adds
devices to the file system, it does not give a listing of those devices. The
answers b and c refer to nonexistent commands.

----------------------------------------------------------------------------
Question 12

E) tail -20 filename

Explanation:

Answer e is correct. Use the command tail -20 filename to see the last 20
lines of a file. The answers for a and d both point to an invalid command.
The answer for b points to a valid command. Typing this answer in with a
valid file name will even give you some output. However, the last command
tells you who is logged in, it does not actually list the contents of any
file named in the command. The answer for c, the head command, is used to
look at the begin-ning of a file, not the end.

----------------------------------------------------------------------------
Question 13

B) rm -rf
C) rmdir

Explanation:

Answers b and c are correct. You can use rmdir or rm -rf to delete a
directory. Answer a is incorrect, because the rm command without any
specific flags will not delete a directory, it will only delete files.
Answers d and e point to a non-existent command.

----------------------------------------------------------------------------
Question 14

E) init

Explanation:

Answer e is correct. The command used to change runlevels is init. Answers
a, c, and d point to invalid commands. Answer b is a valid command, but does
not set the current runlevel. The runlevel command displays the current
runlevel, and the one that was used directly before entering this one.

----------------------------------------------------------------------------
Question 15

A) kill PID
C) kill -9 PID
E) Ctrl+C

Explanation:

Answers a, c, and e are correct. The kill command by itself tries to allow a
process to exit cleanly. You type kill -9 PID, on the other hand, to
abruptly stop a process that will not quit by any other means. Also,
pressing Ctrl+C works for many programs.

Answers b and d are only valid in some contexts, and even in those contexts
will not work on a hung process.

----------------------------------------------------------------------------
Question 16

A) reboot
B) init 6
D) shutdown -r

Explanation:

Answers a, b, and d are correct. The commands used to restart a Linux box
are shutdown -r, reboot, and init 6. Answers c and e are incorrect. Both of
these are used to shut down a Linux box, not restart it.

----------------------------------------------------------------------------
Question 17

D) touch

Explanation:

Answer d is correct. You use the touch command to create an empty file
without needing to open it. Answers a and e point to invalid commands,
though either of these might actually be aliased to point to a real command.
Answers b and c utilize editors, and so do not satisfy the requirements of
the question.

----------------------------------------------------------------------------
Question 18

A) /bin/false

Explanation:

Answer a is correct. You assign a POP3 only account to the /bin/false shell.
Answers b and c both point to the same shell, the bash shell. However,
assigning this shell to a POP3 only user gives him or her login access,
which is what you are trying to avoid. Answers d and e are both invalid
options in a standard setup.

----------------------------------------------------------------------------
Question 19

A) 28 does file locking, 29 does not.
D) Both 28 and 29 have special file system types for mount purposes.

Explanation:

Answers a and d are correct. NFS does not perform file locking but Samba
does. Both NFS and SMB have their own file system types (nfs and smb) for
mount or /etc/fstab.

Answer b is incorrect. NFS only works for other Linux machines. Answer c is
incorrect. Its statements about the services are reversed. Answer e is
incorrect. Both NFS and SMB have special file system types for mounting.

----------------------------------------------------------------------------
Question 20

B) pop3

Explanation:

Answer b is correct. The POP3 service functions as a mail pick-up site but
not a network mail server. Answers a, d, and e are all valid services, and
even valid mail servers. However, they are SMTP mail servers, not POP
servers. Answer c is a valid service but not a mail server.

----------------------------------------------------------------------------