Exercise 1

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
Answer : Option E

Explanation :

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 :

If you type the command cat dog & > cat what would you see on your display? Choose one:

A). Any error messages only.
B). The contents of the file dog.
C). The contents of the file dog and any error messages.
D). Nothing as all output is saved to the file cat.
Answer : Option D

Explanation :

When you use & > for redirection, it redirects both the standard output and standard error. The output would be saved to the file cat.

Question 3 :

You are covering for another system administrator and one of the users asks you to restore a file for him. You locate the correct tarfile by checking the backup log but do not know how the directory structure was stored. What command can you use to determine this? Choose one:

A). tar fx tarfile dirname
B). tar tvf tarfile filename
C). tar ctf tarfile
D). tar tvf tarfile
Answer : Option D

Explanation :

The t switch will list the files contained in the tarfile. Using the v modifier will display the stored directory structure.

Question 4 :

You have the /var directory on its own partition. You have run out of space. What should you do? Choose one:

A). Reconfigure your system to not write to the log files.
B). Use fips to enlarge the partition.
C). Delete all the log files.
D). Delete the partition and recreate it with a larger size.
Answer : Option D

Explanation :

The only way to enlarge a partition is to delete it and recreate it. You will then have to restore the necessary files from backup.

Question 5 :

You have a new application on a CD-ROM that you wish to install. What should your first step be? Choose one:

A). Read the installation instructions on the CD-ROM.
B). Use the mount command to mount your CD-ROM as read-write.
C). Use the umount command to access your CD-ROM.
D). Use the mount command to mount your CD-ROM as read-only.
Answer : Option D

Explanation :

Before you can read any of the files contained on the CD-ROM, you must first mount the CD-ROM.

Question 6 :

What type of server is used to remotely assign IP addresses to machines during the installation process?

D). FT
Answer : Option C

Explanation :

You can use a DHCP server to assign IP addresses to individual machines during the installation process. Answers a, b, d, and e list legitimate Linux servers, but these servers do not provide IP addresses. The SMB, or Samba, tool is used for file and print sharing across multi-OS networks. An NFS server is for file sharing across Linux net-works. FTP is a file storage server that allows people to browse and retrieve information by logging in to it, and HTTP is for the Web.

Question 7 :

Which password package should you install to ensure that the central password file couldn't be stolen easily?

B). tcp_wrappers
C). shadow
D). securepass
E). ssh
Answer : Option C

Explanation :

The shadow password package moves the central password file to a more secure location. Answers a, b, and e all point to valid packages, but none of these places the password file in a more secure location. Answer d points to an invalid package.

Question 8 :

When using useradd to create a new user account, which of the following tasks is not done automatically. Choose one:

A). Assign a UID.
B). Assign a default shell.
C). Create the user's home directory.
D). Define the user's home directory.
Answer : Option D

Explanation :

The useradd command will use the system default for the user's home directory. The home directory is not created, however, unless you use the -m option.

Question 9 :

You want to enter a series of commands from the command-line. What would be the quickest way to do this? Choose One

A). Press enter after entering each command and its arguments
B). Put them in a script and execute the script
C). Separate each command with a semi-colon (;) and press enter after the last command
D). Separate each command with a / and press enter after the last command
Answer : Option C

Explanation :

The semi-colon may be used to tell the shell that you are entering multiple commands that should be executed serially. If these were commands that you would frequently want to run, then a script might be more efficient. However, to run these commands only once, enter the commands directly at the command line.

Question 10 :

You attempt to use shadow passwords but are unsuccessful. What characteristic of the /etc/passwd file may cause this? Choose one:

A). The login command is missing.
B). The username is too long.
C). The password field is blank.
D). The password field is prefaced by an asterisk.
Answer : Option C

Explanation :

The password field must not be blank before converting to shadow passwords.

Question 11 :

When you install a new application, documentation on that application is also usually installed. Where would you look for the documentation after installing an application called MyApp? Choose one:

A). /usr/MyApp
B). /lib/doc/MyApp
C). /usr/doc/MyApp
D). In the same directory where the application is installed.
Answer : Option C

Explanation :

The default location for application documentation is in a directory named for the application in the /usr/doc directory.

Question 12 :

What file would you edit in your home directory to change which window manager you want to use?

A). Xinit
B). .xinitrc
C). XF86Setup
D). xstart
E). xf86init
Answer : Option B

Explanation :

The ~/.xinitrc file allows you to set which window man-ager you want to use when logging in to X from that account. Answers a, d, and e are all invalid files. Answer c is the main X server configuration file.

Question 13 :

What command allows you to set a processor-intensive job to use less CPU time?

A). ps
B). nice
C). chps
D). less
E). more
Answer : Option B

Explanation :

The nice command is used to change a job's priority level, so that it runs slower or faster. Answers a, d, and e are valid commands but are not used to change process information. Answer c is an invalid command.

Question 14 :

While logged on as a regular user, your boss calls up and wants you to create a new user account immediately. How can you do this without first having to close your work, log off and logon as root? Choose one:

A). Issue the command rootlog.
B). Issue the command su and type exit when finished.
C). Issue the command su and type logoff when finished.
D). Issue the command logon root and type exit when finishe
Answer : Option B

Explanation :

You can use the su command to imitate any user including root. You will be prompted for the password for the root account. Once you have provided it you are logged in as root and can do any administrative duties.

Question 15 :

There are seven fields in the /etc/passwd file. Which of the following lists all the fields in the correct order? Choose one:

A). username, UID, GID, home directory, command, comment
B). username, UID, GID, comment, home directory, command
C). UID, username, GID, home directory, comment, command
D). username, UID, group name, GID, home directory, comment
Answer : Option B

Explanation :

The seven fields required for each line in the /etc/passwd file are username, UID, GID, comment, home directory, command. Each of these fields must be separated by a colon even if they are empty.

Question 16 :

Which of the following commands will show a list of the files in your home directory including hidden files and the contents of all subdirectories? Choose one:

A). ls -c home
B). ls -aR /home/username
C). ls -aF /home/username
D). ls -l /home/username
Answer : Option B

Explanation :

The ls command is used to display a listing of files. The -a option will cause hidden files to be displayed as well. The -R option causes ls to recurse down the directory tree. All of this starts at your home directory.

Question 17 :

You have a directory called /home/ben/memos and want to move it to /home/bob/memos so you issue the command mv /home/ben/memos /home/bob. What is the results of this action? Choose one:

A). The files contained in /home/ben/memos are moved to the directory /home/bob/memos/memos.
B). The files contained in /home/ben/memos are moved to the directory /home/bob/memos.
C). The files contained in /home/ben/memos are moved to the directory /home/bob/.
D). The command fails since a directory called memos already exists in the target directory.
Answer : Option A

Explanation :

When using the mv command to move a directory, if a directory of the same name exists then a subdirectory is created for the files to be moved.

Question 18 :

Which of the following tasks is not necessary when creating a new user by editing the /etc/passwd file? Choose one:

A). Create a link from the user's home directory to the shell the user will use.
B). Create the user's home directory
C). Use the passwd command to assign a password to the account.
D). Add the user to the specified group.
Answer : Option A

Explanation :

There is no need to link the user's home directory to the shell command. Rather, the specified shell must be present on your system.

Question 19 :

You issue the following command useradd -m bobm But the user cannot logon. What is the problem? Choose one:

A). You need to assign a password to bobm's account using the passwd command.
B). You need to create bobm's home directory and set the appropriate permissions.
C). You need to edit the /etc/passwd file and assign a shell for bobm's account.
D). The username must be at least five characters long.
Answer : Option A

Explanation :

The useradd command does not assign a password to newly created accounts. You will still need to use the passwd command to assign a password.

Question 20 :

You wish to print the file vacations with 60 lines to a page. Which of the following commands will accomplish this? Choose one:

A). pr -l60 vacations | lpr
B). pr -f vacations | lpr
C). pr -m vacations | lpr
D). pr -l vacations | lpr
Answer : Option A

Explanation :

The default page length when using pr is 66 lines. The -l option is used to specify a different length.

Question 21 :

Which file defines all users on your system? Choose one:

A). /etc/passwd
B). /etc/users
C). /etc/password
D). /etc/user.conf
Answer : Option A

Explanation :

The /etc/passwd file contains all the information on users who may log into your system. If a user account is not contained in this file, then the user cannot log in.

Question 22 :

Which two commands can you use to delete directories?

A). rm
B). rm -rf
C). rmdir
D). rd
E). rd -rf
Answer : Option B, Option C

Explanation :

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 23 :

Which partitioning tool is available in all distributions?

A). Disk Druid
B). fdisk
C). Partition Magic
D). FAT32
E). System Commander
Answer : Option B

Explanation :

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 24 :

Which partitions might you create on the mail server's hard drive(s) other than the root, swap, and boot partitions? [Choose all correct answers]

A). /var/spool
B). /tmp
C). /proc
D). /bin
E). /home
Answer : Option A, Option B, Option E

Explanation :

Separating /var/spool onto its own partition helps to ensure that if something goes wrong with the mail server or spool, the output cannot overrun the file system. Putting /tmp on its own partition prevents either software or user items in the /tmp directory from overrunning the file system. Placing /home off on its own is mostly useful for system re-installs or upgrades, allowing you to not have to wipe the /home hierarchy along with other areas. Answers c and d are not possible, as the /proc portion of the file system is virtual-held in RAM-not placed on the hard drives, and the /bin hierarchy is necessary for basic system functionality and, therefore, not one that you can place on a different partition.

Question 25 :

Of the following technologies, which is considered a client-side script?

A). JavaScript
B). Java
D). C++
Answer : Option A

Explanation :

JavaScript is the only client-side script listed. Java and C++ are complete programming languages. Active Server Pages are parsed on the server with the results being sent to the client in HTML