Using grep to display text
Welcome back and welcome to the power of using regular expressions in the command line. 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 the editing file with sed
.
Global Regular Expression Print (grep), or what we more commonly call the command grep
, 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 section, we have included some simple and useful examples with explanations.
Displaying received data on an interface
In this example, we will print just the received data from the eth0
interface.
Note
This is the interface that is my primary network connection to the Raspberry...