Appendix A
Answers to Review Questions

Chapter 1: Selecting an Operating System

  1. A, B, D, and E. The kernel manages the memory, CPU, and devices for programs running on a computer system, so options A, B, D, and E are correct. The kernel does not manage features of the GUI desktop environment, so option C is incorrect.
  2. A. The Android OS is used on phones as an embedded Linux system, so option A is correct. The CentOS, Fedora, Mint, and Red Hat Linux distributions are full Linux distributions intended for desktop and server environments, and they are not used in embedded systems, making options B, C, D, and E incorrect.
  3. B. Linux’s GUI is based on the X Window System. Although macOS provides an X implementation, its primary GUI is Apple’s proprietary product. Thus, option B is correct. Option A is incorrect because both Linux and macOS can run most GNU programs. Option C is incorrect because Linux can run on both Apple Macintosh and Microsoft-compatible hardware. Option D is incorrect because macOS includes many BSD utilities. Although most Linux distributions use GNU utilities, you can use BSD utilities in Linux if you prefer. Option E is incorrect because both Linux and macOS support text-mode commands, although in macOS you must use the GUI Terminal application.
  4. E. The Linux OS was created by Linus Torvalds while he was a student. Although based on current Linux OSs, it wasn’t derived from any of them, so option E is correct, and options C and D are incorrect. The Linux OS is not derived from either macOS or Windows, so options A and B are also incorrect.
  5. False. Programs known as terminals enable entry of text-mode commands after you’ve logged into Linux in GUI mode. You can also switch between multiple virtual terminals by using keystrokes such as Ctrl+Alt+F2.
  6. True. The CentOS distribution release cycle is approximately every two years, which is long by the standards of other Linux distributions, some of which have release cycles of just six months.
  7. A. The text-mode login prompt is a single text word that prompts you for your user account ID to access the Linux system. The login term is used to prompt for the user to enter his or her userid, so Option A is correct. Options B, C, D, and E are not used as login prompts for the Linux.
  8. D. Most attackers who write viruses focus their energy on the Windows platform where they can find the most victims, so there are very few viruses targeted toward Linux systems. Thus, Option D is correct. Commercial software purchased from reputable vendors is not normally considered a security risk, so Option A is incorrect. Linux systems installed on networks should still utilize network routers and firewalls to protect them from outside attacks, so Options B and C are incorrect. Software management packages such as the Microsoft Store are considered a security feature and not a problem, so Option E is correct.
  9. C. An alpha software release is the first test version of an application or distribution, which hasn’t been fully tested in all environments and most likely contains bugs. The beta software release has been tested in some environments but not all, and it may contain bugs for your particular environments. Thus, Option C is correct. The terms suggested in Options A, B, D, and E are not used to represent standard first and second releases of software packages.
  10. A. A rolling release is provided as needed for a Linux distribution, with no specific release dates or version numbers. Thus, Option A is correct. The terms used in Options B, C, D, and E are not commonly used to indicate version types.

Chapter 2: Understanding Software Licensing

  1. C. Option C does not describe an open source requirement, and so it is the correct answer. The open source definition specifies that users be able to distribute changes, but it doesn’t specify that the license require distribution under the terms of the same license. Options A, B, D, and E all paraphrase actual open source license term requirements.
  2. B. Some distributions (particularly “Enterprise” versions that are sold for money) include software that is neither open source nor even freely redistributable, so option B is correct. Distributions as a whole use many licenses, not just one, so option A is incorrect. The MIT license is one of several open source licenses; such software is not an impediment to copying a distribution, so option C is incorrect. Although some distributions, such as Debian, aim to make their main systems fully open source compliant, not all do this, so option D is incorrect. Likewise, not all distributions are composed completely of free software as the FSF uses the term.
  3. E. Option E paraphrases one of the four key points in the FSF’s philosophy and so is correct. Contrary to option A, the FSF’s philosophy does not mandate use of the GPL, much less its most recent version, although the GPL is the FSF’s preferred license. Option B is contrary to the FSF’s position, which is that free software should remain free; however, this option is compatible with the OSI’s philosophy. Although the FSF advocates free software and free OSs, option C is not an explicit part of their philosophy and so is incorrect. Although the FSF wants to see a world dominated by free software, it does not advocate software piracy, so option D is incorrect.
  4. True. Courts and laws explicitly recognize computer software as being creative works that are governed by copyright law. In some countries, patent laws also apply to software, although this is not globally true.
  5. True. This principle is at the heart of both the free software and the open source software definitions.
  6. False. Hardware vendors often do release open source drivers for their products. One caveat is that the release of open source drivers necessarily renders some programming interfaces for the hardware open, which some hardware vendors are reluctant to do.
  7. D. The Lesser GPL (LGPL) is a variant of the Free Software Foundation’s GPL. Developers often use the LGPL with libraries (collections of code that can be used by other programs).
  8. A. The Creative Commons helps to promote the types of freedoms that also concern the FSF and the OSI, but in a broader sense. Its licenses are typically aimed at audio recordings, video recordings, textual works, as well as computer programs.
  9. C. The term copyleft came about via a play on the word copyright, reflecting the fact that copyright provisions are used to ensure freedoms that are, in some respects, the exact opposite of what copyright was created to do—that is, to guarantee the freedom of users to copy software, rather than to restrict that right. Copyleft is typically used to reflect the FSF philosophy and the licenses it inspires.
  10. E. A bounty is a crowdfunding method that can help bring together users, each of whom individually might not be able to offer enough money to motivate development, to entice programmers to write the desired code. With bounties, the programmer who completes the project first is allowed to collect the project’s accumulated funds.

Chapter 3: Investigating Linux’s Principles and Philosophy

  1. A. Linux’s multitasking is preemptive, meaning that the kernel can give CPU time to any process as it sees fit, potentially interrupting (or preempting) other processes. Thus, option A is correct. Linux is a multiuser OS, but multiuser is not a type of multitasking, so option B is incorrect. In a cooperative multitasking OS, applications must voluntarily give up CPU time to each other. Although Linux programs can signal the OS that they don’t need CPU time, Linux doesn’t rely exclusively on this method, making option C incorrect. A single-tasking OS can run just one process at a time, so option D is incorrect. A single-user OS can support just one user at a time. Such OSs can be either single tasking or multitasking, and in the latter case, can use either cooperative or preemptive multitasking. Thus, option E is incorrect.
  2. C. The open source definition includes 10 points, one of which is that users may modify the original code and redistribute the altered version. Thus, option C is correct. Although all open software is available at no charge, nothing in the open source definition forbids selling it, and in practice, many organizations do sell open source software, so option A is incorrect. The open source definition requires distribution of source code but does not require distribution of binaries, so option B is incorrect. Although many open source projects began life in an academic environment, that’s not a requirement for open source software, so option D is incorrect. The open source definition does not specify that either an interpreted or a compile language be used, making option E incorrect.
  3. D. Evolution is an email reader program. Such programs are commonly used in desktop environments, so option D is correct. Apache is a web server, Postfix is an email server, and BIND is a Domain Name System (DNS) server, which are all unlikely to be run in a desktop computer environment, making options A, B, and E incorrect. Android is the name of a Linux distribution for smartphones and tablets, not a program, so option C is incorrect.
  4. False. VMS was an OS for minicomputers and mainframes when Linux was created. On x86 computers, DOS was the dominant OS in 1991.
  5. True. Digital video recorders (DVRs) are specialized computers for recording TV shows. Some commercial DVRs such as TiVos, run Linux natively. DVR software for standard PCs, such as MythTV, which runs under Linux, also exists.
  6. True. Most server programs do not require the X Window System (X) GUI, so server computer administrators often disable X or even remove it entirely to save disk space and memory and to minimize the risk of security problems.
  7. B. The monolithic kernel design incorporates all of the kernel functions into a single program, whereas the microkernel design splits the kernel functions into separate smaller programs. Thus, Option B is correct. An exokernel design provide minimal hardware support in the kernel, relying on external programs for everything else, thus Option A is incorrect. A hybrid kernel are similar to microkernels, but rely on some external programs to operate, thus Option C is incorrect. The terms distributed and unified are not used to describe kernel types, thus Options D and E are both incorrect.
  8. D. Shareware allows a program author to release the binary executable program to the public without payment but ask for payment if the program is used. Thus, Option D is correct. Open source software does not require a payment, thus Option A is incorrect. Commercial software requires an up-front payment, making Option B incorrect. Freeware doesn’t require any payments at all, making option C incorrect. Viruses are not typically distributed as software packages, making Option E incorrect.
  9. B. A desktop Linux system usually utilizes a graphical desktop interface environment for running graphical programs such as word processors and web browsers, thus Option B is correct. Server computers typically don’t utilize graphical desktops, making Option A incorrect. Distributed computers are typically servers, which don’t utilize graphical desktops, so Option C is incorrect. A client computer may use a graphical desktop, but it’s not required, so Option C is incorrect. A laptop computer may also utilize a graphical desktop, but could also be used as a text-only server, so Option E is incorrect.
  10. Apache. The Apache software package is a web server program written specifically for the Linux server environment, taking advantage of how Linux handles processes and memory for multiple applications. Thus, Option E is correct. The MySQL program is a database server commonly used in Linux, not a web server, so Option A is incorrect. The LibreOffice package is a word processing program, not a web server program, so Option B is incorrect. The Firefox package is a web browser program, not a web server program, so Option C is incorrect. The GIMP package is a graphics processing program, not a web server program, so Option D is incorrect.

Chapter 4: Using Common Linux Programs

  1. B, C, E. GNOME, KDE Plasma, and Xfce are all Linux desktop environments, so options B, C, and E are all correct. (LXDE is also a desktop environment.) The GIMP Toolkit (GTK+) is a GUI programming library. Although GNOME and Xfce are both built atop GTK+, it’s not a desktop environment, so option A is incorrect. Evolution is a Linux email client, not a desktop environment, so option D is incorrect.
  2. B. The Network File System (NFS) was designed for exactly the task described in the question, so option B is correct. The Simple Mail Transfer Protocol (SMTP) enables one computer to send email messages to another computer, so it’s a poor choice for achieving the stated goal, making option A incorrect. The PHP: Hypertext Processor (PHP) language is used to generate dynamic content for web pages, so option C is incorrect. The Domain Name System (DNS) is a protocol for delivering the mappings between hostnames and IP addresses to computers, so it won’t achieve the stated goals, making option D incorrect. The Dynamic Host Configuration Protocol (DHCP) enables one computer to provide network configuration information to another one over a network link, so option E is incorrect.
  3. C. The main language for the Linux kernel is C, so option C is correct. Although Bash shell scripts control much of the Linux startup process, these scripts are not part of the kernel, so option A is incorrect. Java is often used for web-based applications, but it’s not used in the Linux kernel, so option B is incorrect. C++ is a derivative of C that adds object-oriented features to the language, but the Linux kernel uses regular C, not C++, so option D is incorrect. Perl is a popular interpreted language, particularly for tasks that involve processing text, but it’s not the language of the Linux kernel, so option E is incorrect.
  4. False. LibreOffice forked from the pre-Apache version of OpenOffice.org. Calligra split from the KOffice office suite, which is no longer maintained.
  5. True. A denial-of-service (DoS) attack can disrupt a server’s operation by directing an overwhelming quantity of bogus data at the server program, or even just the computer on which it runs. This is true even if the server is impeccably managed.
  6. True. Python, like JavaScript, Perl, PHP, and shell languages, is interpreted. This contrasts with C and C++, which are two common compiled languages, and with Java, which is somewhere in-between.
  7. C. Email client programs enable you to read and write email messages, and can either access a mailbox on your own computer or, using email network protocols, send and receive email over a network. Thunderbird is one common Linux email client. Others include Evolution, KMail, and Mutt.
  8. E. Microsoft uses the SMB/CIFS protocol for file and printer sharing. On Linux, the Samba software implements this protocol.
  9. B. Programmers must convert a program written in a compiled language from its original source code form into the machine code form. The machine code is run later. Programs written in interpreted languages (such as Python, Javascript, and Perl) are converted on a line-by-line basis to machine code at the time they’re run, by a program interpreter.
  10. D. Software programs are bundled into a prebuilt package on Linux, which simplifies their installation and management. Packages are then managed on Linux using a package management system (PMS).

Chapter 5: Getting to Know the Command Line

  1. A. Pressing Ctrl+A moves the cursor to the start of the line when you are editing a command in Bash, so option A is correct. The left arrow key moves a single character to the left, Ctrl+T transposes two characters, the up arrow moves up one item in the history, and Ctrl+E moves to the end of the line.
  2. C, D. Options C and D both describe ways to run a program in the background from a shell, so options C and D are both correct. Neither start nor bg is a command that launches a program in the background. The fg command returns a program to the foreground, meaning that the shell will go back to sleep, which isn’t what the question specified.
  3. D. The less program, like more, displays a text file a page at a time. The less utility also includes the ability to page backward in the text file, search its contents, and do other things that more can’t do. Thus, option D is correct. The grep command searches a file for a specified string, so it doesn’t do a task that’s similar to more, making option A incorrect. The Hypertext Markup Language (HTML) is a file format, often indicated with the filename extension .html, that’s commonly used on the web. As such, it’s not a better version of more, so option B is incorrect. The cat command can concatenate two or more files, or display a single file on the screen. In the former capacity, cat doesn’t do the task of more, and in the latter capacity, cat is less capable than more. Thus, option C is incorrect. The man command displays Linux manual pages. Although man uses less by default, man is not itself an improved version of more, so option E is incorrect.
  4. False. When in the GUI, Ctrl must be added to the VT-switching keystroke, so the correct keystroke in this case is Ctrl+Alt+F3.
  5. True. When you want to override man’s search order, you specify the desired manual section between man and the command name, filename, or other name on which you’re searching.
  6. False. Although info pages, like web pages, use hyperlinks to tie related documents together, the two systems use different formats and protocols. Info pages also reside on the computer’s hard disk; they require no Internet access to read. For these reasons, info pages are not web-based.
  7. False. Individual program authors decide on documentation file format based on their own specific needs and preferences. Although some documents are in OpenDocument text format, many documents are not.
  8. D. Both the logout and the exit commands will end a text-mode terminal session.
  9. C. Each info page document is known as a node, and the info page system as a whole is an interrelated set of nodes. The nodes are organized on levels.
  10. E. The locate command searches a database of filenames that is typically updated every 24 hours. Thus, locate is much quicker than the find command in producing results of files whose names match a specified term.

Chapter 6: Managing Hardware

  1. D. The lspci command displays information about PCI devices. Since many motherboard features appear to Linux as PCI devices, option D provides a great deal of information about your motherboard, making option D correct. The lscpu command provides information about the CPU but nothing else on the motherboard, so option A is wrong. The Xorg program provides information about the display environment but not the motherboard, so option B is incorrect. The fdisk command displays information about a hard drive on the system but not the motherboard, so option C is incorrect. Connecting to web address localhost:631 connects to the CUPS admin web page, which helps you manage printers on your Linux system, but it doesnt tell you anything about the motherboard, making option E incorrect.
  2. A, D. Disk partitioning allows you to separate data of different types into different parts of a disk. Examples of reasons to do this include installing multiple OSs and separating filesystem data from swap space. Thus, options A and D are both correct. The ext4fs and ReiserFS values in option B are both filesystem types, and they don’t have anything to do with partitioning, so option B is incorrect. The disk attachment types PATA and SATA are types of hard drive interfaces and not partition types; you can’t convert one to the other by changing the partition, so option C is incorrect. Partitioning a hard disk doesn’t separate the hard disk cache; that’s an internal feature of the hard drive, so option E is incorrect.
  3. A. Video monitors normally connect to a video card using a standard video interface such as VGA or HDMI, not using the serial USB interface, so option A is the correct selection. Keyboards, external hard disks, printers, and scanners can all connect to the motherboard using a USB interface, so options B, C, D, and E are all incorrect.
  4. True. Most CPU families have multiple names. EM64T is one name that Intel has used for its implementation of the x86-64 architecture, and AMD64 is one of AMD’s names for the same architecture. Thus, the two names identify the same architecture, and an AMD64 Linux distribution will run on an EM64T CPU.
  5. False. The Universal Disk Format (UDF) is a filesystem that’s used primarily on optical discs, not hard disks. Using it for a Linux installation on a hard disk would be awkward if not impossible. Linux-specific filesystems such as ext4s, ReiserFS, or btrfs are the only practical choices for Linux installations on a hard disk.
  6. True. In Linux, most drivers, including those specified, are provided as part of the kernel. Some other drivers, such as those for specialty video cards, printers, and scanners, exist outside the kernel, although they may also rely on kernel drivers to do their work.
  7. B. The x86 hardware architecture refers to 32-bit microprocessor register, making Option B correct. The 8-bit microprocessor was used in the early 8080 microprocessor chip, which doesn’t support Linux, so Option A is incorrect. The 64-bit microprocessor is commonly referred to as amd64 in Linux, since AMD was the first to come out with one, thus, Option C is incorrect. Currently Linux doesn’t support 128 or 256-bit microprocessors, making Options D and E incorrect.
  8. A. Computer hardware requires direct current power electricity to operate, making Option A correct. Three-phase electricity is commonly used for large motors, not computer hardware, making Option B incorrect. Magnetic electricity is generated by rotating magnets, which aren’t used in computer power supplies, making Option C incorrect. Static current is created by rubbing two or more objects together creating friction, and is not used in computer power supplies, making Option D incorrect. Solar power is used by converting the energy produced by the sun into electricity, and is not commonly used to power computers, making Option E incorrect.
  9. D. The HDMI standard is a modern standard for sending digital video signals to monitors, thus Option D is correct. The VGA, SVGA, and SDI standards are old standards for sending analog signals to monitors, thus Options A, C, and E are all incorrect. The LED standard defines how images are displayed on a monitor, not the video interface, so Option B is incorrect.
  10. B and C. The X.org and Wayland X software package are currently used in Linux distributions, making Options B and C both correct. The xFree86 package was the original X software package for Linux, but is no longer in use, making Option A incorrect. The GNOME and KDE Plasma packages are graphical desktop management packages and not X software packages, making Options D and E both incorrect.

Chapter 7: Managing Files

  1. A. The mv command moves or renames a file, so option A is correct. The cp command copies a file so that the original is still in place, so option B is incorrect. The ln command creates a link between two files, so option C is incorrect. The rn command in option D is fictitious, so that option is incorrect. The touch command creates a new empty file or adjusts the time stamps on an existing file, so option E is incorrect.
  2. C. Because two files (outline.pdf and Outline.pdf) have names that differ only in case, and because FAT is a case-insensitive filesystem, one of those files will be missing on the copy. (Both files will be copied, but the second one copied will overwrite the first.) Thus, option C is correct. The specified cp command does not create links, so option A is incorrect. Because the specified cp command included the -a option, which performs a recursive copy, all of the files in MyFiles will be copied, along with the directory itself, so option B is incorrect. In order to copy all of the files, you will have to change one file’s name manually; however, cp won’t do this automatically, so option D is incorrect. Because option C is correct, option E is not correct.
  3. A, B. If you try to create a directory inside a directory that doesn’t exist, mkdir responds with a No such file or directory error. The --parents parameter tells mkdir to create all necessary parent directories automatically in such situations, so option A is correct. You can also manually do this by creating each parent directory separately, so option B is also correct. Option C will have no useful effect; at most, it will change the time stamps on the mkdir program file, but if you type it as a normal user, it probably won’t even do that. Options D and E are both based on the premise that you must remove directories that already exist with the names that you want to use, but this isn’t true, so these options are both incorrect.
  4. True. Symbolic links work by storing the name of the linked-to file in the symbolic link file. Linux reads this filename and transparently substitutes the linked-to file. This process works both on a single filesystem and across filesystems, so the statement is true. Hard links, by contrast, work by providing multiple directory entries that point to a single file. This method of creating a link does not work across low-level filesystems.
  5. False. Linux’s security features prevent accidental damage when you work as an ordinary user. You must be more careful when you acquire root privileges to perform system maintenance, though.
  6. True. The touch command updates a file’s time stamps, and for this purpose, a directory counts as a file, so this statement is true.
  7. D. The -u and --update options of the cp command tell Linux to update the existing file with the specified file, thus Option D is correct. The -f option forces a copy if the destination file cannot be opened, but doesn’t check the file dates, so Option A is incorrect. The -r option copies directories recursively, it doesn’t check file dates, so Option B is incorrect. The -s option creates a symbolic link instead of copying files, so Option C is incorrect. The -v option displays more verbose output, it doesn’t check the file dates, so Option E is incorrect.
  8. D. The -r, -R, and --recursive command-line options of the rm command will recursively remove files from directories, thus Option D is correct. The rmdir command can only remove directories, it can’t remove files inside the directories, so Options A, B, and C are all incorrect. The -f option of the rm command only ignores nonexistent files and doesn’t prompt before removing the files, it doesn’t recursively remove files from directories, so Option E is incorrect.
  9. A. The question mark (?) wildcard character matches none, one, or a set of characters in a filename, so Option A is correct. The asterisk (*) matches zero, one, or multiple characters, not just a single character, so Option C is incorrect. The underscore, period, and dash aren’t used as wildcard characters in matching filenames, so Options B, D, and E are all incorrect.
  10. B. Most Linux applications store their configuration files in the /etc directory structure. Usually these files are only accessible by root or by the user account the application is started with.

Chapter 8: Searching, Extracting, and Archiving Data

  1. A. The grep utility finds matching text within a file and prints those lines. It accepts regular expressions, which means that you can place in brackets the two characters that differ in the words for which you’re looking. Option A shows the correct syntax for doing this. The tar utility creates or manipulates archive files, and option B’s syntax is incorrect for any use of tar, so that option is incorrect. The find utility locates files based on filenames, file sizes, and other surface features. Furthermore, options C and E both present incorrect syntax for find, and so are incorrect. Option D’s cat utility displays or concatenates files, so it won’t have the desired effect, making this option wrong.
  2. E. The >> operator appends standard output to a file, so option E is correct. The vertical bar (|) is the pipe character; it ties one program’s standard output to another’s standard input, so option A is incorrect. The 2> operator redirects standard error, not standard output, and it overwrites the target file. Thus, option B is incorrect. The &> operator redirects both standard output and standard error, and it overwrites the target file, making option C incorrect. The > operator redirects standard output, but it overwrites the target file, so option D is incorrect.
  3. D. With the tar utility, the --list (t) command is used to read the archive and display its contents. The --verbose (v) option creates a verbose file listing, and --file (f) specifies the filename—data79.tar in this case. Option D uses all of these features, and therefore does as the question specifies. Options A, B, C, and E all substitute other commands for --list, which is required by the question, so all of these options are incorrect.
  4. True. The special characters [^x] match any single character except x, and .* matches any sequence of any characters. The string Linus Torvalds is just one of many strings to match the specified regular expression.
  5. True. You can use the -size n option in the find command to locate files based on their sizes.
  6. False. The zip utility creates or manipulates zip archive files. This file type supports compression directly, as does the zip program. Thus, there’s no need to involve another compression program to compress files archived with zip.
  7. A. When not used inside brackets within a regular expression, the caret (^) represents the start of a text line. For example, ^172 matches 172 only if it is first in a line of characters.
  8. B. The cut command can help; in this case it extracts text from specified fields in a file record and displays them. However, no modifications are made to the file.
  9. C. The &> symbol combination redirects both standard output and standard error from the command or program, and into a designated file (or location).
  10. E. Lossless compression is just like it sounds—no data is lost, and the compressed data will exactly match the original uncompressed data, after a decompression process.

Chapter 9: Exploring Processes and Process Data

  1. E. The apt-get command is used to install software packages on Debian-based Linux systems, so option E is correct. The yum and rpm commands are package management commands but are used on Red Hat–based Linux systems, so options A and D are both incorrect. The zypper command is a package management application but is used on openSUSE Linux systems and not Debian-based systems, so option B is incorrect. The dmesg command is used to view the contents of the kernel ring buffer, not to install software, so option C is incorrect.
  2. A, C. The name of the first process that the Linux kernel runs is set in the boot loader configuration file. That program is normally systemd or init, so options A and C are correct. The bash program creates an interactive shell, so option B is incorrect. The login program creates a login prompt on a terminal, allowing users to log into the system, so option D is incorrect. The grub boot loader program is started by the computer BIOS or UEFI system, so option E is incorrect.
  3. A. Most Linux distributions that follow the filesystem hierarchy standard (FHS) store log files in the /var/log directory structure, so option A is correct. Using the FHS, the /etc directory is for storing application configuration files, not log files, so option B is incorrect. The /usr directory is for storing noncritical applications, so option C is incorrect. The 
/home directory is for storing user data, so option D is incorrect. The FHS does not specify a /log directory, so most Linux systems don’t create one, making option E incorrect.
  4. True. Network-enabled package management programs provide a method for ensuring any dependencies required by an application are already installed on the system before installing the application. If not, the package management system either installs them automatically or prompts you to install them first.
  5. True. The top program allows you to sort the process data based on any data field, but by default it displays the data sorted by CPU usage.
  6. True. The dmesg command displays the contents of the kernel ring buffer. The kernel ring buffer stores kernel log messages in a limited space. When that space fills up, older log messages are removed to make room for newer messages. Thus, the contents of the kernel ring buffer (and therefore the dmesg output) change as new events occur in the Linux kernel.
  7. B. The package database maintains a listing of all software packages installed by the package manager program, making Option B correct. The kernel interfaces with the system hardware, it doesn’t manage installed software packages, so Option A is incorrect. The graphical desktop creates a graphical environment to interact with the Linux system, but doesn’t maintain the software packages, so Option C is incorrect. The /usr/lib directory contains library files used by programs, but doesn’t manage software packages, so Option D is incorrect. The Software updater program is part of the software management system, but doesn’t maintain information on installed packages, making Option E incorrect.
  8. A. When you launch an application from the Bash shell it becomes a child process of the shell, so Option A is correct. The parent process is the process that launches the new program, not the new program itself, so Option B is incorrect. The terms client and server are used in an environment where one program retrieves information from another, not in the process environment, so Options C and D are incorrect. Parallel processes are programs that are launched from the same parent process. Since emacs is launched from the Bash shell, it is not a parallel process, so Option E is incorrect.
  9. C. The /var/log/secure file is a common location for some Linux distributions to place general system messages, so Option C is correct. The secure file is commonly used to track user login information, not general system messages, so Option A is incorrect. The dmesg program displays messages logged into the kernel ring buffer by the kernel; it’s not a file that contains general system messages, so Option B is incorrect. The mail file commonly contains messages from the email program on the system, not general system messages, so Option D is incorrect. The wtmp file contains login and logout messages from the system, not general system messages, so Option E is incorrect.
  10. E. The dmesg command displays messages stored in the kernel ring buffer, so Option E is correct. The ls command displays directory listings, not kernel messages, so Option A is incorrect. The pwd command displays the current working directory, not kernel messages, so Option B is incorrect. The chmod command changes file and directory permissions, it doesn’t display kernel messages, so Option C is incorrect. The cat command displays text files, but since the kernel ring buffer is not a text file you cannot use cat to display it, so Option D is incorrect.

Chapter 10: Editing Files

  1. D. LibreOffice, like most word processors, uses a binary format that can’t be properly parsed using an ASCII or Unicode text editor. Thus, nano won’t be useful in examining such a document, making option D correct. The nano text editor can handle ASCII or Unicode format, so the text files described in options A and C are incorrect. The other document types described in options B and E are all likely or certain to be stored in ASCII or Unicode format, making them incorrect choices.
  2. B, E. The F6 and Ctrl+W keystrokes both invoke the search function, so options B and E are correct. The F3 key writes the current buffer to disk, so option A is incorrect. The Esc+S keystroke is an obscure one; it enables or disables smooth scrolling, so option C is incorrect. Ctrl+F moves forward one character, so option D is incorrect.
  3. A. In the vi editor, dd is the command-mode command that deletes lines. Preceding this command by a number deletes that number of lines. Thus, option A is correct. Although yy works similarly, it copies (yanks) text rather than deleting it, so option B is incorrect. Option C works in many text editors but not in vi. Option D works in emacs and similar text editors (including nano) but not in vi. Option E, or something similar, works in many GUI text editors but not in vi, so it is incorrect.
  4. False. Unicode provides support for most alphabets around the world.
  5. False. Support for underlining, italics, multiple fonts, and similar advanced formatting features is present in word processors, not plain-text editors—even GUI text editors lack such support.
  6. True. Due to its ease of use, nano is typically the best editor to learn first.
  7. B. ASCII is a 7-bit code, meaning that it supports a maximum of 128 characters. Though, in practice, ASCII uses 8 bits, so an extra 128 characters are available, which can encode various control characters.
  8. A, C, E. Of the choices shown, the ESC+R and Ctrl+ key combinations as well as pressing the F4 key will start a search-and-replace activity in the nano text editor.
  9. D. Typing u in the vi editor’s command mode will undo the last change you made to the text, which is handy.
  10. C. While you are in command mode, the ZZ key combination will save any file modifications and then leave the vi editor.

Chapter 11: Creating Scripts

  1. A. Before you can run a shell script directly from the command line, you need to allow execute permissions for at least yourself, so option A is correct. You don’t need to have the shell script file located in any specific directory as long as you have access to the directory, so option B is incorrect. Typing the bash scriptname will run the script, not compile it, so option C is incorrect. Viruses are extremely rare in Linux, and because you just created the script, the only way in which it could contain a virus would be if your system was already infected or if you wrote it as a virus, so option D is incorrect. Most spell checkers are intended for English or other human languages, so they lack the ability to check for valid Bash commands, such as esac. Furthermore, even if every keyword is spelled correctly, the script could still contain logic bugs. Thus, option E is incorrect.
  2. C. The cp command is the only one called in the script, and that command copies files. Because the script passes the arguments ($1 and $2) to the cp command in reverse order, their effect is reversed; whereas cp copies its first argument to the second name, the cp1 script copies the second argument to the first name. Option C correctly describes this effect. Option A ignores the reversed order of the arguments, so this option is incorrect. The cp command has nothing to do with compiling C or C++ programs, making options B and D incorrect. The first line in the script is a valid shebang line, indicating the shell to use to run the script, so option E is incorrect.
  3. C. Conditional expressions return a true or false response, enabling the script to execute one set of instructions or another or to continue or terminate a loop; thus, option C is correct. Conditional expressions have nothing to do with licensing conditions, so option A is incorrect, nor do they have anything to do with displaying environment information, making option B incorrect as well. Conditional expressions also don’t implement Pavlovian conditioning by themselves (you can create a script to implement that, but the conditional expressions by themselves don’t), so option D is incorrect. The conditional expressions also don’t cause the script to run only at a specified time of day—you need to use the at or cron facility on the Linux system to do that—so option E is incorrect.
  4. False. The $0 variable contains the name of the script, which would be myscript in this example. The first parameter (laser.txt) would be held in the $1 positional variable.
  5. True. You can use the for statement to execute a loop a fixed number of times, whereas while and until execute until a test condition is no longer met or is met, respectively.
  6. False. The terminal commands don’t have the ampersand (&) sign after them to indicate that they should run in background mode, so they will run serially, only one at a time.QuestionID:
  7. A. A shell script should contain the shebang line to indicate the shell required to run the script. The shebang line contains the #! characters, followed by the shell path. Thus, option A is correct. Options B and D are both incorrect because they just specify the shell, not the shebang characters. Option C is incorrect because it uses only the pound symbol, which makes the line a comment. Option E is incorrect because it doesn’t specify the full path to the shell.
  8. D. The echo command is used to display text to the shell user, so option D is correct. The case command compares a value to multiple answers, not display text, so option A is incorrect. The while command performs a loop on a block of code, and doesn’t display text, so option B is incorrect. The if command tests a condition and if true, executes a block of code, it doesn’t display text, so option C is incorrect. The exit command stops the running script and returns to the shell, passing a numeric exit value, not a text value to display, so option E is incorrect.
  9. A. The case command can compare a variable against multiple values and execute different blocks of code based on the matching value, so option A is correct. The while command performs loops, it doesn’t compare a variable against multiple values, so option B is incorrect. The if command tests a variable against a single condition, not multiple values, so option C is incorrect. The echo command displays text to the script user; it doesn’t compare multiple values, so option D is incorrect. The exit command stops the script and returns to the shell, it doesn’t compare a variable against multiple values, so option E is incorrect.
  10. E. The exit command stops the script and returns a specified value back to the shell, so option E is correct. The case command compares a variable against multiple values, it doesn’t control the script return value, so option A is incorrect. The while command performs a loop on a code block, but doesn’t control the script return value, so option B is incorrect. The if statement allows you to test a variable against a value, but not control the script return value, so option C is incorrect. The echo statement displays text for the script user, but doesn’t control the script return value, so option D is incorrect.

Chapter 12: Understanding Basic Security

  1. A. UID 0 is reserved for the system administrator’s account, also known as root, so option A is correct. The first ordinary user account is not a system account, and its UID is normally 500 or 1000, depending on the distribution, so option B is incorrect. Because A is correct, C cannot be correct. The association of UID 0 for administrative tasks is very basic in Linux, so you won’t find variation on this score, making option D incorrect. Since the root account is not low-privilege, option E is also incorrect.
  2. A, C, E. The /etc/passwd file’s fields specify the username, an encrypted password (or x to denote use of shadow passwords, which is more common), a UID number (option A), a single default GID number, a comment field that normally holds the user’s full name, the path to the account’s home directory (option C), and the path to the account’s default text-mode shell (option E). Option B is incorrect because, although /etc/passwd includes the user’s default group, the user may belong to additional groups that are defined elsewhere. Option D is incorrect because the user’s default desktop environment is not defined in /etc/password.
  3. A. The sudo command is the usual way to execute a single command as root, and option A gives the correct syntax to use it as the question specifies. There is no standard root command, so option B is incorrect. The passwd command changes passwords, so option C is incorrect. Although you can use su to execute a single command as root, you must use it with the -c option to do this, as in su -c “cat /etc/shadow”, so option D is incorrect. Option E’s admin is a fictitious command, so this option is incorrect.
  4. False. The whoami command displays your username only. The id command displays your username, your UID number, your primary group name, your primary GID number, and the group names and GID numbers of all your groups.
  5. False. The name for the group data file in Linux is /etc/group, not /etc/groups.
  6. True. It’s possible to do more damage to a computer as root than as an ordinary user. Thus, you should be extra cautious when using root—run only trusted programs, double-check your commands for errors, and so on.
  7. D. The /etc/passwd file contains not only user account information such as the username, primary group ID, and default shell, but it also contains the UID associated with each username.
  8. B. While the who and the who -q commands will display who is currently logged into the computer, only the w command will also display what programs they are currently running.
  9. E. System accounts have UIDs above 0, but below 500 or even 1,000, depending on the distribution’s configuration. The root account typically has a UID of 0.
  10. C. A company policy that demands the sudo command is used to acquire root privileges sets a desirable nonrepudiation environment in which actions cannot be legally denied.

Chapter 13: Creating Users and Groups

  1. C. The userdel command deletes an account, and the -r switch to userdel causes it to delete the user’s home directory and mail spool, thus satisfying the terms of the question. Option A deletes the account but leaves the user’s home directory intact. Option B does the same; the -f option forces account deletion and file removal under some circumstances, but it’s only meaningful when -r is also used. Option D’s command will probably have no effect, since rm works on directories only in conjunction with -r, and /home/nemo is probably the user’s home directory. Option E’s rm command deletes the user’s home directory (assuming it’s located in the conventional place, given the username) but doesn’t delete the user’s account.
  2. B. The password in option B uses a combination of upper- and lowercase letters, numbers, and symbols, and it doesn’t contain any obvious word. Furthermore, it’s a long password. All of these characteristics make it unlikely to appear in an intruder’s password dictionary and make it hard to guess. Thus, option B represents a good password, and the best of those shown. Option A is the name of a well-known celebrity (at least in the Linux world!); such a name is likely to appear in password-cracking dictionaries, and so makes a poor password choice. Option C is an extremely common password, which makes it a bad choice. Furthermore, it’s short and it consists of just one symbol type (digits). Option D is another popular (and therefore very poor) password. It’s a single common word in all lowercase and it contains no numbers or other nonalphabetic symbols. Although option E is fairly long, it consists entirely of lowercase letters, and its three related words, making it a poor password too.
  3. A. The groupadd command creates a new group, as described in option A, so that option is correct. To add a user to a group, as suggested by option B, you would use the usermod utility. No standard command imports group information from a file, as option C suggests, so this option is incorrect. (Some network user management tools do provide such functionality, though.) To change a user’s default group or list of supplemental groups, you would use usermod, so options D and E are both incorrect.
  4. True. System accounts have UID values between 0 and some number (normally 499 or 999), whereas user accounts have UID values above that number (starting at 500 or 1,000, typically).
  5. False. The usual command-line command for changing passwords is passwd.
  6. True. Although the userdel command’s -r option deletes the user’s home directory and mail files, this command doesn’t track down the user’s files stored in more exotic locations. You can use find to locate such files if you want to delete them or transfer ownership to another user.
  7. D. The useradd command with -u 2019 thor will create a new user account, with the username thor and give it a UID of 2019.
  8. B. In order to modify a user account with the username of carol to a username of marvel, you must issue the usermod -l marvel carol command using super user privileges.
  9. E. The -r option used with the groupadd command will allow you to create a system group (as long as you have super user privileges).
  10. C. The /etc/group file contains group data such as the group’s name, associated GID, and a list of group members.

Chapter 14: Setting Ownership and Permissions

  1. D. The chown command changes the owner assigned to a file. You list the new file owner first, then the filename, making option D correct. You can’t change file ownership using the chmod command, making options B and E incorrect. The new file owner must be listed first by itself, making options A and C incorrect.
  2. C, D. The d at the start of the symbolic file mode indicates that wonderjaye is a directory. The first set of permissions (rwx) indicate the directory owner has read, write, and execute permissions on the directory. The second and third sets of permissions (r-x and r-x) indicate that the directory’s primary group and all others have read and execute permissions on the directory. Thus, options C and D are correct. A leading l character would indicate the file is a symbolic link, so option A is incorrect. A leading dash would indicate the object is a file, but since the leading character is a d option B is incorrect. For members of the group to have write permissions to the directory, the second set of permissions must include the w character, which it doesn’t, so option E is incorrect.
  3. E. The chown command allows you to change both the file’s owner and group, so option E is correct. The groupadd command allows you to add a new group to the system, not change the group assigned to a file, so option A is incorrect. The groupmod command allows you to modify details of a group definition, not change the group assigned to a file, so option B is incorrect. The chmod command allows you to change the permissions assigned to a file, not the file’s primary group, so option C is incorrect. The ls command allows you to display the file owner, group, and permissions using the -l option, but it doesn’t allow you to change the file’s group, so option D is incorrect.
  4. True. The octal mode permission 755 represents the symbolic mode -rwxr-xr-x. The third set of permission characters indicates the permissions for all users on the system, so all users have read permission on the file.
  5. False. The chmod command allows users to change the permissions assigned to a file or directory. Any user can change the permissions of files and directories that the user owns; therefore, any user can use the chmod command.
  6. True. An ordinary user can use chown to change a file’s group to another group the user belongs to, but ordinary users can’t change the ownership of a file—only the root user can do that.
  7. B. The -R (or --recursive) option allows Linux to recursively change the ownership of a directory and all files and directories under it, so option B is correct. The -L option tells Linux to follow any symbolic links encountered in the directory, not recursively change the entire directory tree, so option A is incorrect. The -H option tells Linux to follow the symbolic link if it’s listed as the command-line argument, not recursively change ownership in the entire directory; so option C is incorrect. The -P option tells Linux to not follow any symbolic links in the directory, not recursively change ownership in the directory tree, so option D is incorrect. The -f option tells Linux to suppress any error messages, not recursively change ownership on an entire directory tree, so option E is incorrect.
  8. C. Symbolic permissions are indicated by the three-character string rwx. If a permission is not present, the character is replaced by a dash, so to remove write permissions you would use the character set r-x, making option C correct. The -wx symbol indicates write and execute permissions, so option A is incorrect. The --x symbol indicates no read and write permissions, only execute permissions, so option B is incorrect. The rw- symbol indicates read and write permissions but no execute permission, making option D incorrect. The rwx symbol indicates read, write, and execute permissions, so option E is incorrect.
  9. E. The chmod command uses the character a to represent permissions assigned to all users. To add a permission, you use the plus sign (+), and to represent execute permissions you use the x character. Thus, option E is correct. The u+x symbol assigns execute permissions to only the user, not all users, so option A is incorrect. The u-x symbol removes execute permissions from the user and doesn’t change the permissions for everyone else, so option B is incorrect. The g+x symbol adds execute permissions to the group but not for all users, so option C is incorrect. The a-x symbol removes execute permission for all users—it does not add it—so option D is incorrect.
  10. A. To add a sticky bit to a directory you use the t character and add it to the owner permission set (o), so option A is correct. You add the sticky bit permissions to the owner, not the group, or all users, so options C and D are incorrect. The w character is used to assign write permissions, not the sticky bit, so options B and E are incorrect.

Chapter 15: Managing Network Connections

  1. C, D. The nmtui command provides an interactive text menu for selecting a network interface and setting the network parameters, and the ip command provides a command-line tool for setting network parameters, so both options C and D are correct. The netstat command displays information about network connections but doesn’t set the network parameters, so option A is incorrect. The ping command can send ICMP packets to a remote host but doesn’t set the local network parameters, so option B is incorrect. The route command sets the routing network parameters but not the IP address or subnet mask, so option E is incorrect.
  2. A. The ethtool command displays features and parameters for network cards, so option A is the correct answer. The netstat command displays network statistics and connections, so option B is incorrect. The iwconfig and iwlist commands are used to set wireless network parameters not Ethernet card settings, so options C and D are incorrect. The route command sets or displays routing information and not Ethernet card settings, so option E is incorrect.
  3. E. The ss command displays a list of the open ports on a Linux system, along with the processes associated with each port, so option E is correct. The iwconfig command sets wireless network information, not open ports, so option A is incorrect. The ip command displays or sets network information on a network interface but doesn’t display open ports, so option B is incorrect. The ping command sends ICMP messages to a remote host but doesn’t display any open ports, so option C is incorrect. The nmtui command allows you to configure network parameters for a network interface but doesn’t display the open ports on the system, so option D is incorrect.
  4. A. The default router is used to send packets from the local network to remote networks, so to communicate with a remote host you need to define the default router address, making option A correct. The netmask only defines the local network—it doesn’t define what to do with packets for remote hosts—so option B is incorrect. The host name and IP address only define features of the local host, so options C and D are incorrect, whereas the DNS server defines how to retrieve the IP address of a host based on its domain name, so option E is incorrect.
  5. E. The DNS server maps the host name to an IP address, so you must have a DNS server defined in your network configuration to be able to use host names in your applications. Thus, option E is correct. The default router only defines how to send packets to remote hosts—it doesn’t map the host name to the IP address—so option A is incorrect. The netmask value defines the local network, not how to map host names to IP addresses, so option B is incorrect. The host name and IP address define features of the local host, so options C and D are incorrect.
  6. B. The Dynamic Host Configuration Protocol (DHCP) is used to assign dynamic IP addresses to client workstations on a network, so option B is correct. The default router can’t assign addresses to devices, so option B is incorrect. The ARP table maps the hardware address of the network card to IP addresses but doesn’t assign the IP addresses, so option C is incorrect. The netmask value determines the network address but not the IP address of the host, so option D is incorrect. The ifconfig command can set the static IP address of the host but doesn’t automatically assign the IP address, so option E is incorrect.
  7. A. The dig command can display individual host records for a domain, which you can use to find the MX mail host for the domain, so option A is correct. The host command only displays host IP address information—it can’t determine the server type from the DNS records—so option D is incorrect. The netstat and ss commands display active network connections but not the remote host types, so options B and E are both incorrect. The ping6 command sends IPv6 ICMP packets to test remote hosts but can’t tell if the remote host is a mail server, so option C is incorrect.
  8. A. The ifconfig command must specify the network interface, the IP address, then the netmask option before the netmask address. You can use the up or down option to place the network card in an active or inactive state by default, but it’s not required. Option A is the only option that uses the correct values in the correct order. Option C is close but fails to specify the network interface. Option B is not in the correct format, and options D and E fail to list the necessary configuration settings.
  9. A. The iwlist command displays the available wireless network access points detected by the wireless network card, so option A is correct. The iwconfig command configures the network card to connect to a specific access point but doesn’t list all of the detected access points, making option B incorrect. Option C specifies the ifconfig command, which is used to assign an IP address to a wireless network card, but doesn’t list the access points. The ip command specified in option D likewise can be used to set the IP address of the card but doesn’t list the access points. Option E, the arp command, maps hardware addresses to IP addresses so that you can find duplicate IP addresses on your network, but it doesn’t list the wireless access points.
  10. E. The ip command allows you to both display and set the IP address, netmask, and default router values for a network interface, so option E is correct. The ifconfig command can set the IP address and netmask values, but not the default router. The iwconfig command is used to set the wireless access point settings, and the router command is used to set the default router but not the IP address or netmask values. The ifup command only activates the network interface—it can’t set the address values.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.59.145