Skip to content

Latest commit

 

History

History
61 lines (48 loc) · 930 Bytes

grep.md

File metadata and controls

61 lines (48 loc) · 930 Bytes
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.

Syntax

grep [options] search-pattern [file(s)]

Examples

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