Deck 5: Advanced File Processing
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/51
Play
Full screen (f)
Deck 5: Advanced File Processing
1
You can use the vi editor to create script files.
True
2
____ is NOT a selection command.
A)comm
B)diff
C)grep
D)sed
A)comm
B)diff
C)grep
D)sed
D
3
The ____ redirects the output of one command to the input of another command.
A)output redirection operator (>)
B)input redirection operator (<)
C)pipe operator (|)
D)tilde (~)
A)output redirection operator (>)
B)input redirection operator (<)
C)pipe operator (|)
D)tilde (~)
C
4
The ____ option of the diff command does not compare for blank lines.
A)-b
B)-B
C)-c
D)-C
A)-b
B)-B
C)-c
D)-C
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
5
The ____ option of the grep command displays only lines that do not contain the search pattern.
A)-v
B)-n
C)-o
D)-r
A)-v
B)-n
C)-o
D)-r
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
6
The ____ option of the diff command is used to display the differences side-by-side in columns.
A)-s
B)-c
C)-n
D)-y
A)-s
B)-c
C)-n
D)-y
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
7
You can use the less command with a directory to view its contents one screen at a time,such as less -sbin.
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
8
The pipe operator can connect several commands on the same command line.
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
9
You can use the < operator to redirect a command's output from the screen to a file.
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
10
The ____ option of the diff command shows lines surrounding the line that differs.
A)-d
B)-D
C)-c
D)-C
A)-d
B)-D
C)-c
D)-C
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
11
To append new lines in sed,you must use the ____ command
A)a\
B)-a
C)\a
D)>a
A)a\
B)-a
C)\a
D)>a
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
12
The ____ command removes duplicate lines from a file.
A)grep
B)dup
C)uniq
D)diff
A)grep
B)dup
C)uniq
D)diff
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
13
A popular use of pr is to convert lowercase characters to uppercase characters.
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
14
The ____ option of the diff command ignores blanks that repeat.
A)-b
B)-B
C)-c
D)-C
A)-b
B)-B
C)-c
D)-C
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
15
The ____ command locates identical lines within two identically sorted files.
A)diff
B)sed
C)uniq
D)comm
A)diff
B)sed
C)uniq
D)comm
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
16
When using wc,you cannot specify all three options (-l,-w and -c)in the command line at the same time.
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
17
By default,pr formats the specified files into single-column pages of ____ lines.
A)22
B)33
C)55
D)66
A)22
B)33
C)55
D)66
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
18
The ____ option of the uniq command instructs it to generate as output only the lines of the source file that are not duplicated successively.
A)-d
B)-s
C)-o
D)-u
A)-d
B)-s
C)-o
D)-u
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
19
____ is a selection command.
A)uniq
B)awk
C)sort
D)sed
A)uniq
B)awk
C)sort
D)sed
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
20
You use the ____ command to search for a specified pattern in a file,such as a particular word or phrase.
A)find
B)grep
C)sed
D)diff
A)find
B)grep
C)sed
D)diff
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
21
A shell script should contain not only the commands to execute,but also ____________________ to identify and explain the shell script so that users or programmers other than the script's author can understand how it works.
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
22
The ____ function within the awk command is used to format output.
A)out
B)outln
C)print
D)printf
A)out
B)outln
C)print
D)printf
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
23
Match each command with a statement below.
a.pr
f.diff
b.sed
g.sort
c.comm
h.tr
d.grep
i.wc
e.cut
compares and selects differences in two files
a.pr
f.diff
b.sed
g.sort
c.comm
h.tr
d.grep
i.wc
e.cut
compares and selects differences in two files
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
24
Match each command with a statement below.
a.pr
f.diff
b.sed
g.sort
c.comm
h.tr
d.grep
i.wc
e.cut
compares sorted files and shows differences
a.pr
f.diff
b.sed
g.sort
c.comm
h.tr
d.grep
i.wc
e.cut
compares sorted files and shows differences
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
25
When using the printf function,____ indicates that the output is to appear in decimal digits.
A)%i
B)-i
C)%d
D)-d
A)%i
B)-i
C)%d
D)-d
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
26
The sed editor is sometimes called a(n)____________________ editor because input to sed is rendered in standard output (to display on the screen).
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
27
____________________ commands focus on extracting specific information from files,such as using the comm command to compare file contents.
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
28
You use the ____ character in script files to mark comments.
A)tilde (~)
B)dollar ($)
C)pipe (|)
D)pound (#)
A)tilde (~)
B)dollar ($)
C)pipe (|)
D)pound (#)
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
29
Match each command with a statement below.
a.pr
f.diff
b.sed
g.sort
c.comm
h.tr
d.grep
i.wc
e.cut
counts characters,words,or lines in a file
a.pr
f.diff
b.sed
g.sort
c.comm
h.tr
d.grep
i.wc
e.cut
counts characters,words,or lines in a file
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
30
Match each command with a statement below.
a.pr
f.diff
b.sed
g.sort
c.comm
h.tr
d.grep
i.wc
e.cut
formats and prints
a.pr
f.diff
b.sed
g.sort
c.comm
h.tr
d.grep
i.wc
e.cut
formats and prints
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
31
Match each command with a statement below.
a.pr
f.diff
b.sed
g.sort
c.comm
h.tr
d.grep
i.wc
e.cut
sorts and merges multiple files
a.pr
f.diff
b.sed
g.sort
c.comm
h.tr
d.grep
i.wc
e.cut
sorts and merges multiple files
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
32
By default,each page in the output of pr has a ____-line header,which,by default,contains the current file's name,its last modification date,the current page,and a trailer consisting of blank lines.
A)three
B)four
C)five
D)six
A)three
B)four
C)five
D)six
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
33
Match each command with a statement below.
a.pr
f.diff
b.sed
g.sort
c.comm
h.tr
d.grep
i.wc
e.cut
edits data streams
a.pr
f.diff
b.sed
g.sort
c.comm
h.tr
d.grep
i.wc
e.cut
edits data streams
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
34
____ is a full-featured programming language.
A)Sed
B)Awk
C)Emacs
D)Grep
A)Sed
B)Awk
C)Emacs
D)Grep
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
35
Match each command with a statement below.
a.pr
f.diff
b.sed
g.sort
c.comm
h.tr
d.grep
i.wc
e.cut
selects lines or rows
a.pr
f.diff
b.sed
g.sort
c.comm
h.tr
d.grep
i.wc
e.cut
selects lines or rows
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
36
The first task in the record design phase is to define the ____________________ in the records.
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
37
Bash is a freeware derivative of the Bourne and ____ shells.
A)Korn
B)C
C)csh
D)tsh
A)Korn
B)C
C)csh
D)tsh
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
38
____________________ and transformation commands alter and transform extracted information into useful and appealing formats.
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
39
When you create a shell script to run in Bash,you can immediately run the script by typing ____ and then the name of the script.
A)run
B)sh
C)start
D)exec
A)run
B)sh
C)start
D)exec
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
40
Match each command with a statement below.
a.pr
f.diff
b.sed
g.sort
c.comm
h.tr
d.grep
i.wc
e.cut
selects columns (fields)
a.pr
f.diff
b.sed
g.sort
c.comm
h.tr
d.grep
i.wc
e.cut
selects columns (fields)
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
41
Match each command with a statement below.
a.pr
f.diff
b.sed
g.sort
c.comm
h.tr
d.grep
i.wc
e.cut
translates and deletes character by character
a.pr
f.diff
b.sed
g.sort
c.comm
h.tr
d.grep
i.wc
e.cut
translates and deletes character by character
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
42
In some cases,when you use grep,it is helpful to enter the character pattern you are trying to find in single or double quotes.Why?
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
43
What is the pr command used for?
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
44
What is a record layout?
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
45
What will happen if you execute the following command?
ls -l -sbin | more
ls -l -sbin | more
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
46
What is the wc command used for?
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
47
When you write a script,it is advisable to specify with what shell the script is intended to be used.How can you do this?
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
48
Indicate one advantage to using the Bash shell (instead of the Bourne shell)to run a shell script.
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
49
What is the diff command used for?
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
50
What is tr used for?
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck
51
What is the sed command designed for?
Unlock Deck
Unlock for access to all 51 flashcards in this deck.
Unlock Deck
k this deck