What is grep?
A command that searches files or standard input for lines matching a given pattern (regular expression) and prints them. -i ignores the difference between upper and lower case, -v prints non-matching lines, -c prints the number of matching lines, -n adds line numbers, and -r searches subdirectories as well. -E uses extended regular expressions, and -F treats the pattern as a literal string rather than a regular expression. It returns exit status 0 if any line matches and 1 if none does, so it can also be used in script conditions. Finding error lines in a log or narrowing output in a pipe makes it one of the most used commands on the command line.
Japanese name: grep
grep appears in 3 practice questions across 1 topic, including Linux and Command-Line Basics.