

Some things in this guide may not be working, or need specific tailoring. If you are using grep on another platform than Linux, you may not have the GNU version of grep. Especially if you have to deal often with data, investing some time in doing things efficiently will pay off. And we will include specific use-cases which are common for system administrators and security professionals. Although these sources are a great reference, we will be showing the grep command by example.

The man page is very extensive, so is the online help documentation. Why learn the grep command and regular expressions?Īs with every tool, it is often easy to start using it, but hard to really master it. It is common to use it for checking configuration files and searching through log files. We want to leverage the full potential of the grep command, as it can be used in many work-related or personal related activities. But with all information scattered, most people don’t take the time to really learn the most basic commands. One of the reasons to create this blog post is that there are a lot of examples available for the grep command. Searching inside compressed data (avoid using gunzip!).Find lines ending with a specific string.Find lines starting with a specific string.Recursive search through directories and files.Why learn the grep command and regular expressions?.
