3.2 Searching and Extracting Data from Files Flashcards

1
Q

Search Extract

append

A

> >

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

Search Extract

redirect

A

>

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

Search Extract

grep

search in case insensitive

A

grep -i

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

Search Extract

grep

search is recursive - it searches into all files within the given directory and its subdirs

A

grep -r

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

Search Extract

grep

the search counts the number of matches

A

grep -c

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

Search Extract

grep

inverts the match to print lines that do not match the search term

A

grep -v

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

Search Extract

grep

turns on extended regular expressions (needed by some of the more advanced meta-characters
like | , + and ?)

A

grep -E

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

Search Extract

regular expression

matches any single character (except newline)

A

.

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

Search Extract

regular expression

match any one character within brackets

A

[abcABC]

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

Search Extract

regular expression

match any one character except the ones in brackets

A

[^abcABC]

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

Search Extract

regular expression

match any character in the range

A

[a-z]

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

Search Extract

regular expression

match any one character except the ones in range

A

[^a-z]

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

Search Extract

regular expression

start of line

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

Search Extract

regular expression

End of line

A

$

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

Search Extract

regular expression meta characters

zero or more of the preceeding pattern

A

*

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

Search Extract

regular expression meta characters

one or more of the preceeding pattern

A

+

17
Q

Search Extract

regular expression meta characters

zero or one of the preceeding pattern

A

?

18
Q

Search Extract

regular expression

includes: pot, spot, apot

excludes: potic, spots, potatoe

A

pot$

19
Q

Search Extract

regular expression

Include: arp99, apple, zipper

Exclude: zoo, arrive, attack

A

p+

20
Q

Search Extract

regular expression

Include: arcane, capper, zoology

Exclude: air, coper, zoloc

A

arc|cap|zoo

21
Q

Search Extract

regular expression

Include: 0th/pt, 3th/tc, 9th/pt

Exclude: 0/nm, 3/nm, 9/nm

A

[0-9]th.+

22
Q

Search Extract

regular expression

Include: Hawaii, Dario, Ramiro

Exclude: hawaii, Ian, Alice

A

^[A-Z]a.*i+

23
Q

Search Extract

command can find and replace characters or sets of characters within
a file.

A

sed