In this tutorial, you will learn how to use the grep command in Linux, Unix and OSX, with examples of common use cases.

The grep command in Linux is a utility used to search any given input files for one or more matching words or patterns. It is used to search a single file or an entire directory, including child directories, for a matching string.

Single File Grep Search

To find a word inside of a single file we specify the word we want matched and file to search. For example, to find the word hello in a file named file.txt we would run the following command.

grep "hello" file.txt

#administration #grep #linux

How to use the grep command in Linux with examples
4.45 GEEK