grep and Regular Expressions Flashcards
How do you search for matching characters?
grep
How do you do a reverse grep to show everything except the search?
grep -v
What is the regular expression to search the beginning of a line with matching characters?
i.e grep ^In file
What is the regular expression to search the end of a line with matching characters?
$
i.e grep ing$ file
What is the regular expression to search for a set of characters including an unknown character?
.
i. e grep .ast file
* equivalent of ? in globbing
What is the regular expression to match zero or more preceding characters?
*
i. e grep www* file
* works opposite of globbing wildcard
How do you grep with case insensitivity?
grep -i
What is the regular expression to match multiple specified characters?
[]
i.e ls [SsLlPp]ink
What is the regular expression to match specified numbers?
[1-9]
i. e ls script[1]
i. e ls script[2-7]
What is the regular expression to omit characters when matching?
[^]
i.e ls [^Ioa]oft
When running a command how do you run it against multiple arguments concurrently?
> command< {}
i.e touch{file1,file2,file3}