Chapter 1 - Exploring Linux Command-Line Tools Flashcards
On Linux systems, which file typically now points to a shell program instead of holding a shell program?
A. /bin/bash B. /bin/dash C. /bin/zsh D. /bin/sh E. /bin/tcsh
D. /bin/sh
To see only the current Linux kernel version, which command should you use?
A. uname B. echo $BASH_VERSION C. uname -r D. uname -a E. echo $SHELL
C. uname -r
What will the echo \^New \^Style command display?
A. \^New \^Style B. New Style C. Style New D. ^New ^Style E. \ew \tyle
D. ^New ^Style
You need to determine if the fortytwo.sh program is in a $PATH directory. Which of the following commands will assist you in this task? (Choose all that apply.)
A. which fortytwo.sh. B. cat fortytwo.sh C. echo $PATH D. fortytwo.sh E. /usr/bin/fortytwo.sh
A. which fortytwo.sh.
C. echo $PATH
D. fortytwo.sh
You want to edit the file SpaceOpera.txt and decide to use the vim editor to complete this task. Which of the following are vim modes you might employ? (Choose all that apply.)
A. Insert B. Change C. Command D. Ex E. Edit
A. Insert
C. Command
D. Ex
E. Edit
You have a lengthy file named FileA.txt. What will the head -15 FileA.txt command do?
A. Display all but the last 15 lines of the file
B. Display all but the first 15 lines of the file
C. Display the first 15 lines of the file
D. Display the last 15 lines of the file
E. Generate an error message
C. Display the first 15 lines of the file
You are trying to peruse a rather large text file. A co-worker suggests you use a pager. Which of the following best describes what your co-worker is recommending?
A. Use a utility that allows you to view the first few lines of the file.
B. Use a utility that allows you to view one text page at time.
C. Use a utility that allows you to search through the file.
D. Use a utility that allows you to filter out text in the file.
E. Use a utility that allows you to view the last few lines of the file.
B. Use a utility that allows you to view one text page at time.
Which of the following does not describe the less utility?
A. It does not read the entire file prior to displaying the file’s first page.
B. You can use the up and down arrow keys to move through the file.
C. You press the spacebar to move forward a page.
D. You can use the Esc+V key combination to move backward a page.
E. You can press the X key to exit from the utility.
E. You can press the X key to exit from the utility.
The cat -E MyFile.txt command is entered and at the end of every line displayed is a $.
What does this indicate?
A. The text file has been corrupted somehow.
B. The text file records end in the ASCII character NUL.
C. The text file records end in the ASCII character LF.
D. The text file records end in the ASCII character $.
E. The text file records contain a $ at their end.
C. The text file records end in the ASCII character LF.
The cut utility often needs delimiters to process text records. Which of the following best describes a delimiter?
A. One or more characters that designate the beginning of a line in a record
B. One or more characters that designate the end of a line in a record
C. One or more characters that designate the end of a text file to a command-line text processing utility
D. A single space or a colon (:) that creates a boundary between different data items in a record
E. One or more characters that create a boundary between different data items in a record
E. One or more characters that create a boundary between different data items in a record
Which of the following utilities change text within a file? (Choose all that apply.)
A. cut B. sort C. vim D. nano E. sed
C. vim
D. nano
A Unicode-encoded text file, MyUCode.txt, needs to be perused. Before you decide what utility to use in order to view the file’s contents, you employ the wc command on it. This utility displays 2020 6786 11328 to STDOUT. What of the following is true? (Choose all
that apply.)
A. The file has 2,020 lines in it. B. The file has 2,020 characters in it. C. The file has 6,786 words in it. D. The file has 11,328 characters in it. E. The file has 11,328 lines in it.
A. The file has 2,020 lines in it.
C. The file has 6,786 words in it.
The grep utility can employ regular expressions in its PATTERN . Which of the following best describes a regular expression?
A. A series of characters you define for a utility, which uses the characters to match the same characters in text files
B. ASCII characters, such as LF and NUL, that a utility uses to filter text
C. Wildcard characters, such as * and ?, that a utility uses to filter text
D. A pattern template you define for a utility, which uses the pattern to filter text
E. Quotation marks (single or double) used around characters to prevent unexpected
results
D. A pattern template you define for a utility, which uses the pattern to filter text
Which of the following is a BRE pattern that could be used with the grep command? (Choose all that apply.)
A. Sp?ce B. "Space, the .*frontier" C. ^Space D. (lasting | final) E. frontier$
A. Sp?ce
B. “Space, the .*frontier”
C. ^Space
E. frontier$
You need to search through a large text file and find any record that contains either Luke or Laura at the record’s beginning. Also, the phrase “Father is” must be located somewhere in the record’s middle. Which of the following is an ERE pattern that could be used with the egrep command to find this record?
A. "Luke$|Laura$.*Father is" B. "^Luke|^Laura.Father is" C. "(^Luke|^Laura).Father is" D. "(Luke$|Laura$).* Father is$" E. "(^Luke|^Laura).*Father is.* "
B. “^Luke|^Laura.Father is”