Book: LPI Linux
Certification in a Nutshell Section: Chapter 9. Exam
101 Practice Test
9.2 Answers
-
c. Section 8 holds administrative commands
such as fsck and mkfs.
-
b. Both ps
and top yield process status.
None of the other listed commands are related to processes.
-
e. IDE disk drives are referred to as
/dev/hdx, where x is a,
b, c, or d. Partitions are
numbered from 1 through 4 for primary and extended
partitions and 5 through 16 for logical partitions.
-
d. The tail
command is used for checking the last lines of a text file.
By default, it displays 10 lines.
-
a. The !!
command history expansion executes the previous command.
Entering the Ctrl-P keystroke
uses the Emacs key-binding bash to move up one line in the
history; pressing Enter
executes that command.
-
b, c, and d. fsck is a frontend for the programs
that actually do the checking. e2fsck and
fsck.ext2 are links to the program that checks native
Linux ext2 filesystems.
-
The man
command displays manpages.
-
c. df
reports disk information, including a percentage of the
filesystems used. Answer a is incorrect because /home
may not be the only partition on the physical disk.
-
e. /var and /tmp are mainly
transient, /usr is typically static, /root is
simply a home directory for root, but /etc
contains system configuration information that frequently
changes.
-
d. split -n outfile separates
a file into multiple output files, each with n lines,
and names them outfileaa, outfileab, and so
on. Since the original file had 12 lines and Carolyn split
it into sets of 4 lines, the result is three files named
glaa, glab, and glac, each containing 4
lines.
-
c. CD-ROMs use the iso9660
filesystem, which is the default for mount, but also indicated using
-t. Without the assistance of
an entry in /etc/fstab, both the mount device (
/dev/cdrom) and the mount point ( /mnt/cdrom)
must be provided.
-
b. The write will continue until the hard
limit of 110 MB is reached, after which the write fails and
data is lost.
-
b and d. Without user privilege to the
file, jdoe cannot see the contents. However, as the
file's owner, the mode can be changed to gain access.
Everyone in finance is granted permission, but
jdoe as the owner is denied.
-
b and c. find and locate do not search the contents
of files. /etc/passwd is not a script.
-
cmd1 | cmd2
-
a. The variable must be set and exported.
The semicolon separates the two commands.
-
/etc/group
-
a and c. /etc, /lib,
/bin, /sbin, and /dev must be in the
/root filesystem.
-
cron.
-
d. The first echo argument is unquoted and thus
returns its contents, ls. The
second is quoted with double quotes, which do not preserve
the $, so it too returns
ls. The third is quoted with
single quotes, which do preserve the $, so it returns the string
$MYVAR. The last argument is backquoted, which
means that it returns the result of the command stored in
$MYVAR. The command is ls, which displays the only
file in the directory, Afile1.
-
e. Using the & character puts a program in
the background.
-
d. The tr
program translates characters from one group into another,
including case.
-
b. init, the
grandfather of all processes, always has PID 1.
-
c. The g indicates that we're
operating on the group privilege, and the +s
indicates that we should add the "set id" bit, which means
that the SGID property will be applied.
-
a. User mode 7 is the same as u=rwx, group
mode 5 is the same as g=rx, and other mode
4 is the same as o=r. The ~/ syntax
implies the user's home directory.
-
ln
-s
-
c. The octal dump program, when used with
the -t x option,
will output in hexadecimal notation.
-
d. The -p,
or preserve, option is required to retain dates.
-
d. The [Ll] matches both
letters.
-
a. kill -9
is drastic but necessary for processes unable to respond to
other signals.
-
e. Ctrl-Z
stops the job and gives control back to the terminal. bg places the job into the
background and restarts it.
-
fdisk
-
b. By default, files do not have the
execute privilege, which rules out all responses containing
odd numbers in the mode. They also do not by default have
the sticky bit set, which eliminates response e. Response b
is the result of masking initial bits 666 with umask 027, leaving
640, which is the same as 0640.
-
e. The script has an error and will not
produce the expected output. In a for statement,
the loop variable does not have the dollar sign. Changing
line 2 to for v1 in a1 a2 will correct the error
and produce the output in answer B.
-
c. tar
should be used with the extraction option x and a tape device, such as SCSI
tape /dev/st0.
-
a. cp should
be aliased to the interactive mode with the -i option in .bashrc.
.bash_profile normally doesn't include aliases.
-
d. The nl command numbers lines.
-
b and e. The users option
grants non-privileged users the right to mount and unmount
the filesystem. /dev/fd0 is a floppy device.
-
d. Brackets ([]) are used to group
a character set consisting of numbers 1-8 and characters A-Z
and a-z. The ^ just inside the opening bracket
negates the whole string, such that the string matches
numbers 0, 9, and symbols.
-
d. The shadow password system has been
implemented, placing all passwords in /etc/shadow as
denoted by the x following the username.
-
init 1.
telinit 1 would also work, as
they are both links to the same file.
-
d. The Linux System
Administrators' Guide is a free publication of the
Linux Documentation Project (LDP) and is available online at
http://www.ibiblio.org/mdw/index.html.
-
c. The sticky bit in the mode prevents
deletion by non-owners, but root can still delete the
file.
-
PATH.
-
a. The which
command is used to search the directories specified in
variable PATH.
-
c. The runlevel command yields the
previous and present runlevels.
-
b. /etc/syslog.conf is the
configuration file for the Syslog daemon syslogd.
-
d. pr
converts text files into paginated, columnar versions.
-
c. Since Dave is using a modular kernel,
the network driver 3c509.o is
a kernel module. LILO can send kernel parameters but not
module parameters. These are stored in
/etc/conf.modules.
-
c. While answers b and d are technically
correct, answer c best describes /sbin.
-
SUID.
-
nice.
-
a. cat
concatenates files, and as a subset, will list one or more
files to standard output. tac
lists files in reverse order.
-
b. A metacharacter is a special character
that is used to modify and control the interpretation of
literals. File globbing is generally considered distinct but
very similar to the use of regular expressions.
-
d. PCs usually have two IDE interfaces,
each capable of handling two devices.
-
e. A filesystem without free inodes cannot
create new objects until existing objects are removed.
-
c. This is an example line from the output
of df -h, the
"human-readable" mode of df.
-
d. The shutdown
-f command configures the filesystem to skip the
fsck checking. The -F option forces the check.
-
a. LILO can start the Windows NT boot
loader and many other operating systems.
-
b. The > character opens and
writes to a new file, while >> appends to an
existing file, unless that file doesn't exist, in which case
it is opened first.
|
| |