Intermediate Commands Flashcards

1
Q

What does the [grep] command do?

A

It prints the lines from a file or input stream that match an expression.

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

How is the [grep] command useful?

A

It’s handy when operating on multiple files at once because it prints the filename in addition to the matching filename.

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

What is the syntax for the [grep] command which lets me which files contain a certain expression?

A

[grep expr /path/stream/*]

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

what does [grep -i expr file/path] do?

A

It makes case-insensitive searches.

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

What does [grep -v expr file/path] do?

A

It inverts the search. Printing all lines that don’t match.

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

What do the commands [egrep] and [grep -E] both do?

A

It’s a more.powerful grep option that understands regular expressions.

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

What makes regular expressions better understood by [grep] more powerful than patterns understood by [glob]?

A

Regular expressions are more powerful than wildcard patterns. *(More specific)?

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

What does [.*] do in regular expressions?

A

It matches any number of characters, including none.

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

What does [.+] do in regular expressions?

A

Matches any one or more characters.

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

What does [.] do in regular expressions?

A

It matches exactly one arbitrary character.

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