title | description | created | updated |
---|---|---|---|
grep Linux Command |
grep is a Linux command line utility to search plain text datasets using regular expressions. |
2019-09-13 |
2019-09-13 |
grep is a Linux command line utility to search plain text datasets using regular expressions.
grep [options] search-pattern [file(s)]
Lets take following file as an example to perform grep operations
$ cat readme.txt
Hello World line1
Hello World line2
Hello World line3
Hello World line4
Hello World line5
$ grep 5 readme.txt
Hello World line5
$ grep line4 readme.txt
Hello World line4
$ grep Hello readme.txt
Hello World line1
Hello World line2
Hello World line3
Hello World line4
Hello World line5
$ grep -i hello readme.txt
Hello World line1
Hello World line2
Hello World line3
Hello World line4
Hello World line5
Note: -i is to ignore case