LPIC-1 Linux Professional Institute Certification Study Guide. Richard Blum
E. The
wc
command displays a count of newlines, words, and bytes in the specified file (report.txt
). Piping this data through tee
causes a copy of the output to be stored in the new file (wc
in this example – you shouldn't run this command in the same directory as the wc
executable file!). Thus, option E is correct. Contrary to option A, wc
is not an editor, and the remaining syntax wouldn't cause two files to open in separate windows even if wc
were an editor. Contrary to option B, wc
doesn't count windows or open a new window. Option C describes the effect of wc report | wc– that is, it overlooks the tee
command. Contrary to option D, wc
has nothing to do with cleaning up memory leaks, and tee
doesn't directly use the report.txt
file. For more information, see Chapter 1, “Exploring Linux Command-Line Tools.”
7. C. The grub.cfg
filename indicates a GRUB 2 configuration file. In such files, each OS or kernel stanza begins with a menuentry
line and an open curly brace ({
) and ends with a close curly brace (}
). Thus, option C is correct. Some configuration files and programming languages use semicolons (;) at the end of most lines, but this isn't true of GRUB 2, so option A is incorrect. Although close parentheses ()
) are used to terminate some types of options in some configuration files, including disk identifiers in GRUB 2's configuration file, they aren't used to terminate whole OS or kernel definitions in this file, so option B is incorrect. The string */
terminates comments in C program files but isn't commonly used in GRUB 2 configuration files, so option D is incorrect. Option E would be correct if the question had asked about a GRUB Legacy configuration file (menu.lst
or grub.conf
), but the question specifies a GRUB 2 configuration file (grub.cfg
); the two boot loaders terminate their OS/kernel stanzas differently, so option E is incorrect. For more information, see Chapter 5, “Booting Linux and Editing Files.”
8. E. The third field of /etc/passwd
entries holds the UID number for the account, so option E is correct. Linux doesn't use any standard identifier called a human ID (HID; option A), although the acronym HID stands for human interface device, a class of USB devices. Accounts don't have PID numbers (option B); those belong to running processes. The account's GID number (option C) is stored in the fourth field of /etc/passwd
—100
in this example. Linux accounts don't use globally unique ID (GUID) numbers, so option D is incorrect. For more information, see Chapter 7, “Administering the System.”
9. B. The grep
command scans files to find those that contain a specified string or pattern, as described by option B. In the case of text files, grep
displays the matching line or lines; for binary files, it reports that the file matches the pattern. The method of creating a pipeline (option A) involves separating two commands with a vertical bar (|
). The grep
command can be used in a pipeline, but it doesn't create one. The command that concatenates files (option C) is cat
, and the command that displays the last several lines of a file (option D) is tail
. Several commands, such as find
, locate
, and whereis
locate files (option E), but grep
is not among them. For more information, see Chapter 1.
10. B, D, E. ReiserFS (option B) was written from scratch for Linux. The Third Extended Filesystem (ext3fs; option D) is a journaling filesystem based on the older non-journaling Second Extended Filesystem (ext2fs; option C). The Extents Filesystem (XFS; option E) is a journaling filesystem written by SGI for Irix and later ported to Linux. The Virtual File Allocation Table (vfat; option A) is a non-journaling filesystem designed by Microsoft for Windows. For more information, see Chapter 3, “Configuring Hardware.”
11. A. Option A correctly describes the features of SSH and GPG in this context. Option B is incorrect because SSH should do a fine job of encrypting your email so that it can't be decoded between your system and your ISP's email server. Option C has it backward; email transferred via SSH will be completely encrypted, including both headers and body. GPG doesn't encrypt headers, just message bodies. Option D is incorrect because GPG isn't a virus scanner, just an encryption tool. Option E is incorrect because the SSH tunnel will encrypt everything in the SMTP transfer, including email attachments. For more information, see Chapter 10.
12. A, D. Port 110 (option A) is assigned to the Post Office Protocol (POP), and port 143 (option D) is assigned to the Internet Message Access Protocol (IMAP), both of which may be used to retrieve email messages from an email server system. Port 119 (option B) is assigned to the Network News Transfer Protocol (NNTP), port 139 (option C) is assigned to the Server Message Block/Common Internet File System (SMB/CIFS) protocol, and port 443 (option E) is assigned to the Hypertext Transfer Protocol with SSL encryption (HTTPS), none of which is commonly used for email retrieval. For more information, see Chapter 8.
13. C. Log files, such as /var/log/messages
and sometimes others in /var/log
, often contain useful information concerning server errors. The tail
program displays the last few lines of a file, so using it to examine log files immediately after a problem occurs can be a useful diagnostic procedure. Option C correctly combines these features. The http://localhost:631
URL of option A accesses the Common Unix Printing System (CUPS) configuration utility, which has nothing to do with SSH. There is no standard diagnose
utility (option B) to help diagnose server problems, and there is no standard /dev/ssh
file (option D). The sshd program is the SSH server itself, so option E will simply launch the server. For more information, see Chapter 5.
14. B. The ∼./profile
file is one of several bash
startup scripts, as stated in option B. It has nothing to do with the ProFTP server (option A) or the tcsh
shell (option D). The ProFile file manager mentioned in option C is fictitious. Users' encrypted passwords (option E) are usually stored in /etc/shadow
. For more information, see Chapter 9, “Writing Scripts, Configuring Email, and Using Databases.”
15. E. The at
utility was created to run programs at one specified point in the future. Thus, option E will accomplish the stated goal. Options A and C might also work, but neither is the best way to accomplish this goal. Option A will tie up CPU time, and if the program crashes or the system is shut down during the intervening two years, the message will never be displayed. Option C would be more reliable, but it adds unnecessary complexity to your hourly cron
job schedule. The cal
program displays a text-mode calendar, enabling you to identify the days of a week for a given month; it doesn't schedule future jobs, as option B suggests. A GUI calendar program, as specified in option D, might work, but NTP is the Network Time Protocol, a protocol and like-named program for synchronizing clocks across a network. Thus, NTP isn't the tool for the job, and option D is incorrect. For more information, see Chapter 7.
16. D. Option D provides the correct command to add 172.24.21.1 as the default gateway. Options A and B both use the fictitious gateway
command, which doesn't exist and therefore won't work unless you create a script of this name. Option C uses the correct route
command, but there is no gateway
option to route
; you must use add default gw
, as in option D. There is no standard gw
command, so option E is incorrect. For more information, see Chapter 8.
17. B, C. The BRLTTY package is an add-on daemon for handling a Braille display device, and some features for using these devices have been added to the 2.6.26 kernel, so options B and C are correct. Emacspeak (option A) is speech-synthesis