We will be beginning this journey by looking at the grep command. This will enable us to grasp some simple concepts of searching through the text before moving onto more complex regular expressions and editing files with sed.
Global regular expression print (grep), or what we more commonly call the grep command, is a command-line tool used to search globally (across all the lines in a file) and print the result to STDOUT. The search string is a regular expression.
The grep command is such a common tool that it has many simple examples and numerous occasions where we can use it each day. In the following sections, we have included some simple and useful examples with explanations.