grep and Regular Expressions Flashcards

1
Q

How do you search for matching characters?

A

grep

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

How do you do a reverse grep to show everything except the search?

A

grep -v

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

What is the regular expression to search the beginning of a line with matching characters?

A

i.e grep ^In file

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

What is the regular expression to search the end of a line with matching characters?

A

$

i.e grep ing$ file

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

What is the regular expression to search for a set of characters including an unknown character?

A

.

i. e grep .ast file
* equivalent of ? in globbing

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

What is the regular expression to match zero or more preceding characters?

A

*

i. e grep www* file
* works opposite of globbing wildcard

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

How do you grep with case insensitivity?

A

grep -i

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

What is the regular expression to match multiple specified characters?

A

[]

i.e ls [SsLlPp]ink

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

What is the regular expression to match specified numbers?

A

[1-9]

i. e ls script[1]
i. e ls script[2-7]

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

What is the regular expression to omit characters when matching?

A

[^]

i.e ls [^Ioa]oft

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

When running a command how do you run it against multiple arguments concurrently?

A

> command< {}

i.e touch{file1,file2,file3}

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