Grep Flashcards

(10 cards)

1
Q

Q: What is the most common command used to search for information using regular expressions in Linux?

A

A: grep (short for global regular expression print)

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

Q: What does the grep command do?

A

Searches files for patterns of characters using regular expression metacharacters. The command name is short for “global regular expression print.”

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

Q: What command is used to search using extended regular expressions?

A

A: egrep or grep -E

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

Q: What command is used to search without interpreting regular expressions for faster results?

A

A: fgrep or grep -F

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

what does the egrep command do?

A

A variant of the grep command used to search files for patterns, using extended regular expressions.

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

what dose the fgrep command do?

A

A variant of the grep command that does not allow the use of regular expressions.

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

what does the -i option for for grep?

A

makes it case insensitive

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

how do search ONLY for a speicife word and no other words?

A

“(chr space) word (chrspace)”

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

what does the dot reprsent in the following? grep “t.e”
project 4

A

any character AND what the command is doing is search for any line that has a word that starts with t and ends in e with any char inbetween in project4

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

how do you view lines that start with a spefic word or char give the command?

A

grep “^ (word or phase) “

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