Chapter 1 - Exploring Linux Command-Line Tools - Seat6 Flashcards

1
Q

Three important commands used to combine two or more files into one file are?

pg.22

A

cat
join
paste

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The cat command’s name is short for ________,
and what does it do?

pg.22

A

concatenate,

It links together an arbitrary number of files end to end and sends the results to standard output.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the join command do?

pg.23

A

combines 2 files by matching the contents of specified fields within the files. Fields are typically space-separated entries on a line.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the paste command do?

pg.24

A

merges files line by line, separating the lines from each file with tabs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does sed command do?

pg.25

A

it is an important file-transforming command.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does the sort command do?

pg.26

A

allows you to sort an output file you created.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are 5 different commands you can sort with?

pg.26

A
Ignore Case: -f or --ignore-case
Month Sort:  -M or --month-sort
Numeric Sort:  -n or --numeric-sort
Reserve Sort order:  -r or --reverse
Sort Fields: -k or --key=field
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the split command do?

pg.26

A

allows you to split a file into two or more files. This command requires you to enter an output filename or, more precisely, an output filename prefix, to which is added an alphabetic code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the commands to specify how large you want the individual files split?

pg.26

A

Split by Bytes: -b size or –bytes=size
Split by Bytes by Line-Sized Chunks: -C=size or –line-bytes=size
Split by Number of Lines: -l lines or –lines=lines

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What command changes individual characters and relies on standard input?

pg.27

A

tr command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What command is the logical opposite of expand and can convert multiple spaces to tabs?

pg.27

A

unexpand command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What command removes duplicate lines?

pg.28

A

uniq command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What command allows you to clean up a file by cleaning up paragraphs which it assumes are delimited by two or more blank lines or by changes in indentation?

pg.28

A

fmt command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What command will allow you to do more complex line numbering and numbering all the non-blank lines in a file?

pg.29

A

nl command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What command allows you to prepare a file with headers, footers, and page breaks?

pg.30

A

pr command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How can you tweak the output format in a variety of ways?

pg.30

A

Generate Multicolumn Output: -numcols or –columns=numcols
Generate Double-Spaced Output: -d or –double-space
Use Form Feeds: -f or –form-feed
Set Page Length: -l lines or –length=lines
Set the Header Text: -h text or –header=text
Set Left Margin and Page Width: -o char or –indent=chars