Deck 5: Advanced File Processing

Full screen (f)
exit full mode
Question
You can use the vi editor to create script files.
Use Space or
up arrow
down arrow
to flip the card.
Question
____ is NOT a selection command.

A)comm
B)diff
C)grep
D)sed
Question
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 (~)
Question
The ____ option of the diff command does not compare for blank lines.

A)-b
B)-B
C)-c
D)-C
Question
The ____ option of the grep command displays only lines that do not contain the search pattern.

A)-v
B)-n
C)-o
D)-r
Question
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
Question
You can use the less command with a directory to view its contents one screen at a time,such as less -sbin.
Question
The pipe operator can connect several commands on the same command line.
Question
You can use the < operator to redirect a command's output from the screen to a file.
Question
The ____ option of the diff command shows lines surrounding the line that differs.

A)-d
B)-D
C)-c
D)-C
Question
To append new lines in sed,you must use the ____ command

A)a\
B)-a
C)\a
D)>a
Question
The ____ command removes duplicate lines from a file.

A)grep
B)dup
C)uniq
D)diff
Question
A popular use of pr is to convert lowercase characters to uppercase characters.
Question
The ____ option of the diff command ignores blanks that repeat.

A)-b
B)-B
C)-c
D)-C
Question
The ____ command locates identical lines within two identically sorted files.

A)diff
B)sed
C)uniq
D)comm
Question
When using wc,you cannot specify all three options (-l,-w and -c)in the command line at the same time.
Question
By default,pr formats the specified files into single-column pages of ____ lines.

A)22
B)33
C)55
D)66
Question
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
Question
____ is a selection command.

A)uniq
B)awk
C)sort
D)sed
Question
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
Question
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.
Question
The ____ function within the awk command is used to format output.

A)out
B)outln
C)print
D)printf
Question
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
Question
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
Question
When using the printf function,____ indicates that the output is to appear in decimal digits.

A)%i
B)-i
C)%d
D)-d
Question
The sed editor is sometimes called a(n)____________________ editor because input to sed is rendered in standard output (to display on the screen).
Question
____________________ commands focus on extracting specific information from files,such as using the comm command to compare file contents.
Question
You use the ____ character in script files to mark comments.

A)tilde (~)
B)dollar ($)
C)pipe (|)
D)pound (#)
Question
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
Question
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
Question
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
Question
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
Question
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
Question
____ is a full-featured programming language.

A)Sed
B)Awk
C)Emacs
D)Grep
Question
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
Question
The first task in the record design phase is to define the ____________________ in the records.
Question
Bash is a freeware derivative of the Bourne and ____ shells.

A)Korn
B)C
C)csh
D)tsh
Question
____________________ and transformation commands alter and transform extracted information into useful and appealing formats.
Question
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
Question
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)
Question
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
Question
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?
Question
What is the pr command used for?
Question
What is a record layout?
Question
What will happen if you execute the following command?
ls -l -sbin | more
Question
What is the wc command used for?
Question
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?
Question
Indicate one advantage to using the Bash shell (instead of the Bourne shell)to run a shell script.
Question
What is the diff command used for?
Question
What is tr used for?
Question
What is the sed command designed for?
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/51
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
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
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 (~)
C
4
The ____ option of the diff command does not compare for blank lines.

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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 (#)
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
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
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
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
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
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
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
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
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
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)
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
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
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
locked card icon
Unlock Deck
Unlock for access to all 51 flashcards in this deck.