Ch 4 Flashcards

1
Q

less

A

Opens the text file in a pager, which allows for easy reading

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

cat

A

dumps the contents of the text file on the screen

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

head

A

Shows the first ten lines of the text file

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

tail

A

shows the last ten lines of the text file

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

cut

A

used to filter specific columns or characters from a text file

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

sort

A

sorts the contents of a text file

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

wc

A

counts the number of lines, words and characters in a text file

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

^text

A

Matches line that starts with specified text

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

text$

A

Matches line that ends with specified text

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

*

A

wildcard

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

[abc]

A

matches a, b or c

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

?

A

Extended regular expression that matches zero or one of the preceding character

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

+

A

Extended regular expression that matches on or more of the preceding characters

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

*

A

matches zero to an infinite number of the previous character

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

{2}

A

matches exactly two of the previous character

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

colou?r

A

matches zero or one of the previous character

17
Q

(…)

A

used to group multiple characters so that the regular expression can be applied to the group

18
Q

grep -i

A

matches upper and lower case letters

19
Q

grep -v

A

shows only lines that do not contain regular expressions

20
Q

grep -r

A

seraches files in the current directory and all subdirectories

21
Q

grep -e

A

searches for lines matching more than one regular expression. Use -e before each regular expression you want to use

22
Q

grep -E

A

interprets the search pattern as an extended regular expression

23
Q

grep -A <number></number>

A

shows <number> of lines after the matching regular expression</number>

24
Q
A