Deck 4: Unix-Linux File Processing

Full screen (f)
exit full mode
Question
System administrators and programmers refer to standard output as ____.

A)sout
B)stout
C)stdout
D)standardout
Use Space or
up arrow
down arrow
to flip the card.
Question
To redirect the list of the files in a directory to a file called homedir.list,you enter ____.

A)ls < homedir.list
B)ls > homedir.list
C)homedir.list < ls
D)homedir.list > ls
Question
You can use the ____ command to create empty files.

A)touch
B)create
C)make
D)null
Question
In UNIX-Linux,text files and binary files are considered to be ____ files.

A)executable
B)document
C)regular
D)dynamic
Question
The ____ option of the find command displays files that have been changed within the last n minutes.

A)-min n
B)-cmin n
C)-nmin n
D)-mmin n
Question
UNIX-Linux store data,such as letters,product records,or vendor reports,in flat ASCII files.
Question
Moving and renaming a file are essentially the same operation.
Question
When you no longer need a file,you can delete it using the ____ command.

A)rm
B)remove
C)dl
D)delete
Question
System administrators and programmers refer to standard input as ____.

A)sin
B)stin
C)stdin
D)standardin
Question
The cp ____ option creates a symbolic link or name at the destination rather than a physical file.

A)-s
B)-y
C)-l
D)-n
Question
When you no longer need a directory,you can use command ____ to remove it.

A)xtree
B)rmdir
C)dldir
D)deltree
Question
You can complete a project using awk that you cannot complete using a combination of paste,cut,sort,and join.
Question
When you are moving files,using the -o option with the mv command can be a good idea so that you don't unexpectedly overwrite a destination file with the same name.
Question
When you use the paste command,by default,the pasted results appear in columns separated by commas.
Question
To move a file,you use the ____ command along with the source file name and destination name.

A)rm
B)rename
C)mv
D)move
Question
The command > accountsfile ____.

A)deletes de file accountsfile
B)is not valid in UNIX/Linux systems
C)displays the contents of the file accountsfile on the screen
D)creates an empty file called accountsfile
Question
The command rmdir can be used to delete a directory that is not empty.
Question
You can use the ____ operator to redirect commands or program error messages from the screen to a file.

A)1>
B)2>
C)3>
D)4>
Question
Character special files are used by input-output devices for communicating one character at a time,providing what is called ____ data.

A)raw
B)binary
C)ASCII
D)block
Question
When you use cat to combine two files into a third file,the first line of the output contains the first line of the first file followed by the first line of the second file.
Question
The ____ option of the find command displays files that have been changed within the last n days.

A)-cdays n
B)-ctime n
C)-mdays n
D)-mtime n
Question
The ____________________ option of the paste command causes files to be pasted one after the other instead of in parallel.
Question
Match each item with a statement below.
a.-name
f.-i
b.-r
g.-u
c.-c
h.paste
d.>
i.-t
e.-d
when deleting a directory with rm,this option is used to recursively delete its files and subdirectories
Question
You can use the ____________________ command to associate lines in two files on the basis of a common field in both files.
Question
Match each item with a statement below.
a.-name
f.-i
b.-r
g.-u
c.-c
h.paste
d.>
i.-t
e.-d
option of the mv command that overwrites a destination file with the same name,if the source file is newer than the one in the destination
Question
Match each item with a statement below.
a.-name
f.-i
b.-r
g.-u
c.-c
h.paste
d.>
i.-t
e.-d
option of the cp command that provides a warning before an existing file with the same name is overwritten
Question
____________________ special files are related to devices,such as disks,and send information using blocks of data.
Question
To run the myscript shell script located in the current directory,you should enter: ____.

A)start myscript
B)/.myscript
C)run myscript
D)./myscript
Question
The join command is used to associate information in two different files on the basis of a common field or ____ in those files.

A)index
B)link
C)column
D)key
Question
Although the touch command cannot alter a file's ____________________ changed date and time,it can alter the file's access and modification dates and times.
Question
You can use the ____________________ command to sort a file's contents alphabetically or numerically.
Question
When you use find,it is useful to note that some UNIX versions require the ____ option after the file name to display the names of files.

A)-display
B)-print
C)-show
D)-names
Question
When UNIX-Linux detect errors in processing system tasks and user programs,they direct the errors to ____________________,which,by default,is the screen.
Question
A sorting ____ is a field position within each line.

A)index
B)key
C)column
D)position
Question
If you execute ____,the contents of file1 are sorted and the results are stored in file2.

A)sort file1 -o file2
B)sort file1 -d file2
C)sort file1 > file2
D)sort file1 file2
Question
The ____ command is used to look for patterns in files.

A)awk
B)find
C)pattern
D)search
Question
Match each item with a statement below.
a.-name
f.-i
b.-r
g.-u
c.-c
h.paste
d.>
i.-t
e.-d
this option prevents the touch command from creating a file,if it does not already exist
Question
The paste command normally sends its output to ____.

A)stdout
B)null
C)stderr
D)the file indicated as an argument
Question
The ____ option of the paste command is used to specify a different separator as a delimiter.

A)-t
B)-o
C)-d
D)-s
Question
You can use the ____________________ command to remove specific columns or fields from a file.
Question
Match each item with a statement below.
a.-name
f.-i
b.-r
g.-u
c.-c
h.paste
d.>
i.-t
e.-d
option of the sort command used to indicate that a specific character separates the fields
Question
Match each item with a statement below.
a.-name
f.-i
b.-r
g.-u
c.-c
h.paste
d.>
i.-t
e.-d
can be used with cat to combine the contents of two files
Question
Describe some tasks that the awk command can perform.
Question
What is a shell script?
Question
What is the find command used for?
Question
What is Awk?
Question
Assuming project1,project2 and project3 are files,what is the purpose of entering the following command?
cp project1 project2 project3 duplicates
Question
Match each item with a statement below.
a.-name
f.-i
b.-r
g.-u
c.-c
h.paste
d.>
i.-t
e.-d
is an option of the find command
Question
What is the purpose of entering the following command?
cat janes_research marks_research > total_research
Question
What is the purpose of entering the following command?
cp designs-* duplicates
Question
Consider a simple file,called vegetables,containing the following four lines:
Carrots
Spinach
Lettuce
Beans
We also have a bread file that contains the following four lines:
Whole wheat
White bread
Sourdough
Pumpernickel
What will be the result of executing the following command?
paste -d',' vegetables bread > food
Question
Match each item with a statement below.
a.-name
f.-i
b.-r
g.-u
c.-c
h.paste
d.>
i.-t
e.-d
combines files side by side
Question
Match each item with a statement below.
a.-name
f.-i
b.-r
g.-u
c.-c
h.paste
d.>
i.-t
e.-d
option of the cut command used to indicate that a specific character separates the fields
Question
What is a variable-length record?
Question
What is a fixed-length record?
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/55
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 4: Unix-Linux File Processing
1
System administrators and programmers refer to standard output as ____.

A)sout
B)stout
C)stdout
D)standardout
C
2
To redirect the list of the files in a directory to a file called homedir.list,you enter ____.

A)ls < homedir.list
B)ls > homedir.list
C)homedir.list < ls
D)homedir.list > ls
B
3
You can use the ____ command to create empty files.

A)touch
B)create
C)make
D)null
A
4
In UNIX-Linux,text files and binary files are considered to be ____ files.

A)executable
B)document
C)regular
D)dynamic
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
5
The ____ option of the find command displays files that have been changed within the last n minutes.

A)-min n
B)-cmin n
C)-nmin n
D)-mmin n
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
6
UNIX-Linux store data,such as letters,product records,or vendor reports,in flat ASCII files.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
7
Moving and renaming a file are essentially the same operation.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
8
When you no longer need a file,you can delete it using the ____ command.

A)rm
B)remove
C)dl
D)delete
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
9
System administrators and programmers refer to standard input as ____.

A)sin
B)stin
C)stdin
D)standardin
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
10
The cp ____ option creates a symbolic link or name at the destination rather than a physical file.

A)-s
B)-y
C)-l
D)-n
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
11
When you no longer need a directory,you can use command ____ to remove it.

A)xtree
B)rmdir
C)dldir
D)deltree
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
12
You can complete a project using awk that you cannot complete using a combination of paste,cut,sort,and join.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
13
When you are moving files,using the -o option with the mv command can be a good idea so that you don't unexpectedly overwrite a destination file with the same name.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
14
When you use the paste command,by default,the pasted results appear in columns separated by commas.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
15
To move a file,you use the ____ command along with the source file name and destination name.

A)rm
B)rename
C)mv
D)move
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
16
The command > accountsfile ____.

A)deletes de file accountsfile
B)is not valid in UNIX/Linux systems
C)displays the contents of the file accountsfile on the screen
D)creates an empty file called accountsfile
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
17
The command rmdir can be used to delete a directory that is not empty.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
18
You can use the ____ operator to redirect commands or program error messages from the screen to a file.

A)1>
B)2>
C)3>
D)4>
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
19
Character special files are used by input-output devices for communicating one character at a time,providing what is called ____ data.

A)raw
B)binary
C)ASCII
D)block
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
20
When you use cat to combine two files into a third file,the first line of the output contains the first line of the first file followed by the first line of the second file.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
21
The ____ option of the find command displays files that have been changed within the last n days.

A)-cdays n
B)-ctime n
C)-mdays n
D)-mtime n
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
22
The ____________________ option of the paste command causes files to be pasted one after the other instead of in parallel.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
23
Match each item with a statement below.
a.-name
f.-i
b.-r
g.-u
c.-c
h.paste
d.>
i.-t
e.-d
when deleting a directory with rm,this option is used to recursively delete its files and subdirectories
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
24
You can use the ____________________ command to associate lines in two files on the basis of a common field in both files.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
25
Match each item with a statement below.
a.-name
f.-i
b.-r
g.-u
c.-c
h.paste
d.>
i.-t
e.-d
option of the mv command that overwrites a destination file with the same name,if the source file is newer than the one in the destination
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
26
Match each item with a statement below.
a.-name
f.-i
b.-r
g.-u
c.-c
h.paste
d.>
i.-t
e.-d
option of the cp command that provides a warning before an existing file with the same name is overwritten
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
27
____________________ special files are related to devices,such as disks,and send information using blocks of data.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
28
To run the myscript shell script located in the current directory,you should enter: ____.

A)start myscript
B)/.myscript
C)run myscript
D)./myscript
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
29
The join command is used to associate information in two different files on the basis of a common field or ____ in those files.

A)index
B)link
C)column
D)key
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
30
Although the touch command cannot alter a file's ____________________ changed date and time,it can alter the file's access and modification dates and times.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
31
You can use the ____________________ command to sort a file's contents alphabetically or numerically.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
32
When you use find,it is useful to note that some UNIX versions require the ____ option after the file name to display the names of files.

A)-display
B)-print
C)-show
D)-names
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
33
When UNIX-Linux detect errors in processing system tasks and user programs,they direct the errors to ____________________,which,by default,is the screen.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
34
A sorting ____ is a field position within each line.

A)index
B)key
C)column
D)position
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
35
If you execute ____,the contents of file1 are sorted and the results are stored in file2.

A)sort file1 -o file2
B)sort file1 -d file2
C)sort file1 > file2
D)sort file1 file2
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
36
The ____ command is used to look for patterns in files.

A)awk
B)find
C)pattern
D)search
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
37
Match each item with a statement below.
a.-name
f.-i
b.-r
g.-u
c.-c
h.paste
d.>
i.-t
e.-d
this option prevents the touch command from creating a file,if it does not already exist
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
38
The paste command normally sends its output to ____.

A)stdout
B)null
C)stderr
D)the file indicated as an argument
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
39
The ____ option of the paste command is used to specify a different separator as a delimiter.

A)-t
B)-o
C)-d
D)-s
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
40
You can use the ____________________ command to remove specific columns or fields from a file.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
41
Match each item with a statement below.
a.-name
f.-i
b.-r
g.-u
c.-c
h.paste
d.>
i.-t
e.-d
option of the sort command used to indicate that a specific character separates the fields
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
42
Match each item with a statement below.
a.-name
f.-i
b.-r
g.-u
c.-c
h.paste
d.>
i.-t
e.-d
can be used with cat to combine the contents of two files
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
43
Describe some tasks that the awk command can perform.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
44
What is a shell script?
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
45
What is the find command used for?
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
46
What is Awk?
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
47
Assuming project1,project2 and project3 are files,what is the purpose of entering the following command?
cp project1 project2 project3 duplicates
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
48
Match each item with a statement below.
a.-name
f.-i
b.-r
g.-u
c.-c
h.paste
d.>
i.-t
e.-d
is an option of the find command
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
49
What is the purpose of entering the following command?
cat janes_research marks_research > total_research
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
50
What is the purpose of entering the following command?
cp designs-* duplicates
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
51
Consider a simple file,called vegetables,containing the following four lines:
Carrots
Spinach
Lettuce
Beans
We also have a bread file that contains the following four lines:
Whole wheat
White bread
Sourdough
Pumpernickel
What will be the result of executing the following command?
paste -d',' vegetables bread > food
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
52
Match each item with a statement below.
a.-name
f.-i
b.-r
g.-u
c.-c
h.paste
d.>
i.-t
e.-d
combines files side by side
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
53
Match each item with a statement below.
a.-name
f.-i
b.-r
g.-u
c.-c
h.paste
d.>
i.-t
e.-d
option of the cut command used to indicate that a specific character separates the fields
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
54
What is a variable-length record?
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
55
What is a fixed-length record?
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 55 flashcards in this deck.