Chapter 8 Flashcards

1
Q

Many Linux programs employ blank, which are tools for expressing patterns in text.

A

regular expressions

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

Name the two most common forms of regular expression

A

basic and extended

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

Characters enclosed in square brackets constitute blank, which match any one character within the brackets

A

Bracket Expressions

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

Including a blank after the opening square bracket matches against any character except the ones specified.

A

caret ^

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

A blank is a variant on a bracket expression. Instead of listing every character that matches the start and end point are separated by a dash.

A

Range expressions

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

The dot (.) represents any blank except a newline.

A

single character

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

A blank consists of all the characters before the line is terminated with a new line.

A

text line (sometimes called a record)

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

When not in brackets the blank represents the start of a line.

A

caret ^

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

Blank represents the end of a line.

A

dollar sign $

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

An blank represents zero or more matches and is commonly used with a dot (.) to specify a substring.

A

asterisk *

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

If you want to match a special character such as (.), you must escape it by using what?

A

backslash /

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

With repetition operators, a blank matches one or more occurrences while a blank specifies zero or one.

A

plus +
question mark ?

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

The blank separates two possible matches.

A

vertical bar |

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

Blank surround subexpressions and are often used to specify how to apply operators.

A

Parenthesis ()

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

The blank command searches for files that contain a specified string and returns the name of the file and (if it’s a text file) the line containing the string

A

grep

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

You can also use blank to search a specified file for a specified string

A

grep

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

What option(s) with the grep command displays the number of lines that match, rather than the lines that contain matches to the regular expression

A

–count or -c

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

What option(s) with the grep command takes pattern input from the specified file rather than from the command line. The fgrep command is a shortcut for this option.

A

–file=file or -f file

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

What option(s) with the grep command performs a case-insensitive search, rather than the default case-sensitive search

A

–ignore-case -i

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

What option(s) with the grep command searches in the specified directory and all subdirectories rather than simply the specified directory. The rgrep is a shortcut for this command.

A

– recursive -R or -r

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

What option(s) with the grep command to use a regular expression. Alternatively, you can call egrep

A

–extended- regexp or -E

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

Blank is when you must enclose regular expressions in quotes. Otherwise, the shell will incorrectly treat the regular expressions as shell commands.

A

shell quoting

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

The blank utility uses a brute-force approach to finding files.

A

find

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

What option(s) with the find command searches for files using their name. Doing so finds files that match the specified pattern. This pattern is a shelled wildcard pattern and not a regular expression

A

-name pattern

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

What option(s) with the find command to find files that have certain permissions. The mode may be expressed either symbolically or through octal.

A

-perm mode

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

What option(s) with the find command to search for files based on size.

A

-size n

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

What option(s) with the find command to search for files that belong to the specified group.

A

-group name

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

What option(s) with the find command to search for files whose GroupID is set to GID

A

-gid GID

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

What option(s) with the find command to search for files that are owned by a specified user

A

-user name

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

What option(s) with the find command to search for files by user UID number

A

-uid UID

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

What option(s) with the find command to limit the search of a directory and, perhaps, some limited number of subdirectories

A

-maxdepth levels

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

The blank command provides how many words or lines are in a text file.

A

wc

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

What option(s) with the wc command displays the file’s byte count

A

–bytes or -c

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

What option(s) with the wc command displays the files character count

A

–chars or -m

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

What option(s) with the wc command displays the file’s newline count

A

–lines or -l

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

What option(s) with the wc command displays the file’s word count

A

–words or -w

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

What option(s) with the wc command displays the length of the longest line in the file

A

–max-line-length or -L

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

What command do you use when you only want part of a file record?

A

cut

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

What option(s) with the cut command selects only designated character position(s)?

A

–characters -c

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

What option(s) with the cut command uses the designated delimiter as the field delimiter instead of the default delimiter(tab)

A

–delimiter -d

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

What option(s) with the cut command selects only designated fields

A

–fields -f

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

What option(s) with the cut command prevents lines without a delimiter from being printed

A

–only-delimited -s

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

What command allows you to sort large amounts of data

A

sort

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

What option(s) with the sort command considers only blanks and alphanumeric characters, but ignores special characters

A

–dictionary-order or -d

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

What option(s) with the sort command ignores case

A

–ignore-case -f

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

What option(s) with the sort command sorts string by numeric value

A

–numeric-sort or -n

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

What option(s) with the sort command writes result to the specified file

A

–output-file or -o

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

What option(s) with the sort command sorts in descending order

A

–reverse or -r

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

Though blank is often used for displaying short text files on screen, it can also concatenate files together

A

cat

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

The cat command needs how many files as an argument to concatenate into a new file

A

two

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

If you want to use a program’s output for future reference, you can blank it to a file

A

redirect

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

Redirection is achieved with the help of blank, which are short strings that appear after the command and its argument

A

Redirection operator

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

The output of redirection comes in what two types?

A

Standard output
Standard error

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

What redirection operator creates a new file containing standard output. It rewrites if the specified file already exists.

A

>

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

What redirection operator appends standard output to the existing file. If the specified file does not exist, it creates it.

A

> >

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

What redirection operator creates a new file containing error messages. If the specified file already exists, it is overwritten

A

2>

57
Q

What redirection operator appends standard error to the existing file. If the specified file does not exist, it is created.

A

58
Q

What redirection operator creates a new file containing both standard output and standard error. If the specified file exists, it is overwritten.

A

&>

59
Q

What redirection operator sends the contents of the specified file to be used as standard input

A

<

60
Q

What redirection operator accepts the text on the following lines as standard input

A

«

61
Q

What redirection operator causes the specified file to be used for both standard input and standard output

A

<>

62
Q

In a blank, standard output from one program is redirected as standard input to a second program.

A

pipe

63
Q

The blank command’s purpose in a pipeline is to build a command from its standard input

A

xargs

64
Q

GIve the xargs basic syntax

A

xargs [OPTIONS] [COMMAND [INITIAL-ARGUMENTS]]

65
Q

Text placed within two blank is treated as a separate command whose results are substituted on the command line

A

back ticks `

66
Q

Using backticks in this way is called blank, because you are providing a substitution for one of the command’s arguments

A

command substitution

67
Q

Name the other and more favorable way of denoting command substitution

A

$()

68
Q

The tar’s program name stands for blank

A

tape archive

69
Q

Regardless of its name, you can use blank to backup (or archive) data to your hard disk or other media, not just to tapes

A

tar

70
Q

Because an archive file can be quite large, it is often compressed via the tar program into a blank

A

tarball

71
Q

Whenever you run tar, you use blank option and usually at least one blank

A

one
qualifier

72
Q

Name the tar option(s) that creates an archive

A

–create or -c

73
Q

Name the tar option(s) that appends tar files to an archive

A

–concatenate or -A

74
Q

Name the tar option(s) that appends non-tar files to an archive

A

–append or -r

75
Q

Name the tar option(s) that appends files that are newer than those in an archive

A

–update or -u

76
Q

Name the tar option(s) that compares an archive to files on the disk

A

–diff or –compare or -d

77
Q

Name the tar option(s) that lists an archive’s contents

A

–list or -t

78
Q

Name the tar option(s) that extracts files from an archive

A

–extract or –get or -x

79
Q

Name the tar qualifier(s) that changes to directory dir before performing operations

A

–directory dir or -C

80
Q

Name the tar qualifier(s) that uses the file called file on the computer called host as the archive file

A

–file[host:]file or -f

81
Q

Name the tar qualifier(s) that performs an incremental backup or restore, using file as a list of previously archived files

A

–listed-incremental file or -g

82
Q

Name the tar qualifier(s) that backs up only one filesystem(partition)

A

–one-file-system

83
Q

Name the tar qualifier(s) that creates or extracts a multitape archive

A

–multi-volume or -M

84
Q

Name the tar qualifier(s) that changes tapes after N kilobytes

A

–tape-length N or -L

85
Q

Name the tar qualifier(s) that preserves all protection information

A

–same-permissions or -p

86
Q

Name the tar qualifier(s) that retains the leading / on filenames

A

–absolute-names or -P

87
Q

Name the tar qualifier(s) that lists all files read or extracted; when used with –list displays the file sizes, ownership, and time stamps

A

–verbose or -v

88
Q

Name the tar qualifier(s) that verifies the archive after writing it

A

–verify or -W

89
Q

Name the tar qualifier(s) that excludes file from the archive

A

–exclude file

90
Q

Name the tar qualifier(s) that excludes files listed in file from the archive

A

–exclude-from file or -X

91
Q

Name the tar qualifier(s) that processes an archive through gzip

A

–gzip or –ungzip or -z

92
Q

Name the tar qualifier(s) that processes an archive through bzip2

A

–bzip2 or -j or( -I or -y older)

93
Q

In Linux, the blank, blank, and blank all compress individual files.

A

gzip, bzip2, xz

94
Q

Of the three compression commands, which provides the least compression?

A

gzip

95
Q

Of the three compression commands, which provides the most compression?

A

xz

96
Q

What is the decompression program for gzip?

A

gunzip

97
Q

What is the decompression program for bzip2?

A

bunzip2

98
Q

What is the decompression program for xz?

A

unxz

99
Q

What is the filename extension for gzip?

A

.gz

100
Q

What is the filename extension for bzip2?

A

.bz2

101
Q

What is the filename extension for xz?

A

.xz

102
Q

What is the tarball filename extension for gzip?

A

.tgz

103
Q

What is the tarball filename extension for bzip2?

A

.tbz or .tbz2 or .tb2

104
Q

What is the tarball filename extension for xz?

A

.txz

105
Q

The gzip, bzip2 and xz compression programs all apply blank, meaning the data recovered by uncompressing the file is identical to what went into it

A

lossless compression

106
Q

Some graphics, audio, and audiovisual file formats apply blank, in which some data is discarded

A

lossy compression

107
Q

Outside of the Unix and Linux world, the blank file format is a common one that fills a role similar to a compressed tarball.

A

zip

108
Q

What option used with the zip command sets the amounts of compression from low to high

A

-0 through -9

109
Q

What option used with the zip command deletes the specified files from the archive file?

A

–delete or -d

110
Q

What option used with the zip command encrypts the archive with a password

A

–encrypt or -e

111
Q

What option used with the zip command updates the file in an archive if they’ve changed since the original archive’s creation

A

–freshen or -f

112
Q

What option used with the zip command performs on repairs on a damaged archive file.

A

–fix or -F (minimal)
–fixfix or -FF

113
Q

What option used with the zip command updates the file in an archive if they’ve changed since the original archive’s creation

A

–filesync or -FS

114
Q

What option used with the zip command appends files to an existing archive

A

–grow or -g

115
Q

What option used with the zip command displays basic help information

A

–help or -h or -?

116
Q

What option used with the zip command moves the files into the zip archive - that is, the original files are deleted

A

–move or -m

117
Q

What option used with the zip command includes files subdirectories inside the directories you specify

A

–recurse-paths or -r

118
Q

What option used with the zip command creates a potentially multifile archive with each file no larger than size bytes

A

–split-size size or -s size

119
Q

What option used with the zip command excludes the specified files

A

–exclude files or -x files

120
Q

What option used with the zip command includes symbolc links

A

–symlinks or -y

121
Q

What option used with the unzip command freshens files from the archive

A

-f

122
Q

What option used with the unzip command lists files in the archive but does not extract them

A

-l

123
Q

What option used with the unzip command extracts files to a pipeline

A

-p

124
Q

What option used with the unzip command test the integrity of files in the archive

A

-t

125
Q

What option used with the unzip command updates the files, but also extracts files that don’t exist on the filesystem

A

-u

126
Q

What option used with the unzip command lists files in the archive in a more verbose format than -l does

A

-v

127
Q

What option used with the unzip command converts filenames to lowercase if they originated on an uppercase-only OS, such as DOS

A

-L

128
Q

What option used with the unzip command never overwrites existing files

A

-n

129
Q

What option used with the unzip command overwrites existing files without prompting

A

-o

130
Q

Which of the following commands will print lines from world.txt that contains matches to changes and changed

A. grep changes[ds] world.txt
B. tar change[d-s] world.txt
C. find “change’d|s” world.txt
D. cat world.txt changes changed
E. find change[^ds] world.txt

A

A

131
Q

Which of the redirection operators appends a program’s standard output to an existing file without overwriting that file’s original contents.

A

> >

132
Q

You’ve received a tar archive, but you want to check the name of the files it contains before you extract them. Which of the following commands would you use to do this?

A. tar uvf data79.tar
B. tar cvf data79.tar
C. tar xvf data79.tar
D. tar tvf data79.tar
E. tar Avf data79.tar

A

D

133
Q

True or False: the regular expression Linu[^x].*lds matches the string Linus Torvalds

A

True

134
Q

True or False: The find command allows you to locate files based on size

A

True

135
Q

True or False: To compress files archived with zip, you must use an external compression program such as gzip, xz, or bzip2 in a pipeline with zip

A

False

136
Q

The blank command can extract specified data fields from a file’s records

A

cut

137
Q

Complete the following command to redirect both standard output and standard error from the bigprog program to the file out.txt.

$bigprog blank out.txt

A

&>

138
Q

THe gzip, bzip2, and xz programs all perform blank compression.

A

Lossless