Linux Essentials Chapter 6-10
Complete the following command to redirect both standard output and a standard error from the bigprog program to the file out.txt. bigprog __ out.txt
&>
You want to copy a file (origfile.text) to the backups directory, but if a file called origfile.txt exists in the backups directory, you want to go ahead with the copy only if the file in the source location is newer than the one in backups. The command to do this is cp ____ origfile.txt backups/.
-u or --update
What directory primarily contains system configuration files?
/etc
ASCII supports __ unique characters (not including control characters)
128
Which wildcard character matches any one symbol in a filename?
?
Which of the following commands will print lines from the file world.txt that contains matches to "changes" and "changed"? A. grep change[ds] world.txt B. tar change[d-s] world.txt C. find "change'd|s'" world.txt D. cat world.txt changes changed E. find change[^ds] world.txt
A
Where do most log files reside on a Linux computer? A. /var/log B. /etc/logging C. /usr/log D. /home/logging E. /log/usr
A. /var/log
You type mkdir /one/two/three and receive an error message that reads, in part, NO SUCH FILE OR DIRECTORY. What can you do to overcome this problem? (Select all that apply). A. Add the --parents parameter to the mkdir command. B. Issue three separate mkdir commands: mkdir one, mkdir one/two, mkdir one/two/three. C. Type touch /bin/mkdir to be sure that the mkdir program file exists. D. Type rmdir one to clear away the interfering base of the desired new directory tree. E. Type rm -r one ot clear away the entire interfering directory tree.
A. Add the --parents parameter to the mkdir command. B. Issue three separate mkdir commands: mkdir one, mkdir one/two, mkdir one/two/three.
What keystroke moves the cursor to the start of the line when typing a command in Bash? A. Ctrl+A B. Left arrow C. Ctrl+T D. Up arrow. Ctrl+E
A. Ctrl+A
How would you remove two lines of text from a file when using vi? A. In command mode, position the cursor on the first line and type 2dd. B. In command mode, position the cursor on the last line and type 2yy. C. In insert mode, position the cursor at the start of the first line, hold down the Shift key while pressing the down-arrow key twice, and press the Delet key on the keyboard. D. In insert mode, position the cursor at the start of the first line and press Ctrl+K twice. E. Select the text with the mouse, and then select File > Delete from the menu.
A. In command mode, position the cursor on the first line and type 2dd.
What is the usual name of the first process that the Linux kernel runs, aside from itself? A. init B. bash C. cron D. login E. grub
A. init
Which of the following commands would you type to rename newfile.txt to afile.txt? A. mv newfile.txt afile.txt B. cp newfile.txt afile.txt C. ln newfile.txt afile.txt D. rn newfile.txt afile.txt E. touch newfile.txt afile.txt
A. mv newfile.txt afile.txt
Which keystrokes invoke the pico or nano search function? (Select all that apply) A. F3 B. F6 C. Esc-S D. Ctrl+F E. Ctrl+W
B. F6 E. Ctrl+W
How can you run a program in the background when launching it from a shell? (Select all that apply.) A. Launch the program by typing start command, where command is the command you want to run. B. Launch the program by typing bg command, where command is the command you want to run. C. Append an ampersand (&) to the end of the command line. D. Launch the program normally, type Ctrl+Z in the shell, and then type bg in the shell. E. Launch the program normally, type Ctrl+Z in the shell, and then type fg in the shell.
C. Append an ampersand (&) to the end of the command line. D. Launch the program normally, type Ctrl+Z in the shell, and then type bg in the shell.
You want to copy a directory, MyFiles, to a USB flash drive that uses the FAT filesystem. The contents of MyFiles are as follows: $ ls -l MyFiles/ total 276 -rw-r-r- 1 jen users 129840 Nov 8 15:13 contract.odt -rw-r-r- 1 rod users 42667 Nov 8 15:12 outline.pdf -rw-r-r- 1 sam users 105979 Nov 8 15:12 Outline.PDF The USB flash drive is mounted at /media/usb, and so you can type cp -a MyFiles/media/usb. What problem will occur when you attempt to copy these files? A. The command will fail because it tries to create links. B. The MyFiles directory will be copied, but none of its files will be copied. C. One file will be missing on the USB flash drive. D. One file's name will be changed during the copy. E. Everything will be fine. The command will work correctly.
C. One file will be missing on the USB flash drive.
Three keystrokes that can initiate a search-and-replace operation in nano are F14, __, and __.
Ctrl+\ or M-R
For which type of file is nano LEAST likely to be useful for examining or editing? A. A test file encoded in Unicode B. A shell script file C. A text file encoded in ASCII D. A LibreOffice word processing document E. A Linux configuration file
D. A LibreOffice word processing document
Which of the following commands is an improved version of more? A. grep B. html C. cat D. less E. man
D. less
You've received a tar archive called data79.tar from a colleague, but you want to check the names of the files it contains before extracting them. Which of the following commands would you use to do this? A. tar uvf data79.tar B. tar cvf data79.tar C. tar xvf data79.tar D. tar tvf data79.tar E. tar Avf data79.tar
D. tar tvf data79.tar
Which of the following tools is best suited to installing a software package and all of its dependencies on a Debian computer? A. yum B. zypper C. dmesg D. rpm E. apt-get
E
Which of the following redirection operators appends a program's standard output to an existing file without overwriting that file's original contents? A. | B. 2> C. &> D. > E. >>
E. >>
T/F: GUI text editor for ASCII are superior to text-mode ASCII text editors because the GUI editors support underlining, italics, and multiple fonts.
F
T/F: Linux documentation in the /usr/share/doc directory tree is almost always in OpenDocument text format.
F
T/F: To compress files archived with zip, you must use an external compression program such as gzip or gzip2 in a pipeline with zip.
F
T/F: Unicode is useful for encoding most European languages but not Asian languages.
F
T/F: You can easily damage your Linux installation by mistyping an rm command when you log into your regular account.
F
T/F: info pages are a web-based documentation format.
F
T/F: Pressing Alt+F2 in the GUI brings up a text-mode display that you can use to log in to Linux.
F (should be Ctrl+Alt+F2 in X)
T/F The dmesg command may produce different output after a computer has been running for weeks than when it first started.
T
T/F: By default, the first process listed in top is currently consuming the most CPU time.
T
T/F: If you have never used a text editor before, the nano text editor is usually the best one to learn first.
T
T/F: The find command enables you to locate files based on their sizes.
T
T/F: The regular expression Linu[^x].ASTERISKlds matches the string Linus Torvalds.
T
T/F: When using suitable commands, you can install a program and be sure that all of the software on which it depends will also be installed, provided you have an Internet connection.
T
T/F: You can create a symbolic link from one low-level filesystem to another.
T
T/F: You can force man to display a man page in a specific section of the manual by preceding the search name with the section number, as in man 5 passwd.
T
T/F: You can set a directory's time stamps with the touch command.
T
The character that represents the start of a line in a regular expression is __.
^
Type logout or __ to end a text-mode terminal session.
exit
The __ command searches a database of filenames, enabling you to identify files quickly whose names match a term that you specify.
locate
The gzip, bzip2, and xz programs all perform __ compression, in which the uncompressed data exactly matches the original precompression data.
lossless
Each document in an info page is known as a(n) __.
node
Most Linux distributions maintain information on what packages are installed in the __ __ (two words).
package database
You've typed rmdir junk to delete the junk directory, but this command has failed because junk contains word processing files. What command might you type to do the job?
rm -r junk, rm -R junk, rm --recursive junk
While in vi's command mode, you can type __ to undo a change.
u
To save a file and exit vi text editor in command mode, type __.
zz