Intermediate Commands Flashcards
What does the [grep] command do?
It prints the lines from a file or input stream that match an expression.
How is the [grep] command useful?
It’s handy when operating on multiple files at once because it prints the filename in addition to the matching filename.
What is the syntax for the [grep] command which lets me which files contain a certain expression?
[grep expr /path/stream/*]
what does [grep -i expr file/path] do?
It makes case-insensitive searches.
What does [grep -v expr file/path] do?
It inverts the search. Printing all lines that don’t match.
What do the commands [egrep] and [grep -E] both do?
It’s a more.powerful grep option that understands regular expressions.
What makes regular expressions better understood by [grep] more powerful than patterns understood by [glob]?
Regular expressions are more powerful than wildcard patterns. *(More specific)?
What does [.*] do in regular expressions?
It matches any number of characters, including none.
What does [.+] do in regular expressions?
Matches any one or more characters.
What does [.] do in regular expressions?
It matches exactly one arbitrary character.