Tag Archives: grep Command

Uses Of Grep Command In Unix And Linux Server

Uses Of Grep Command In Unix And Linux Server

The name, “grep” is indicative of the operation which this command performs. It is executed using the Unix/Linux text editor ed: g/re/p

* grep Command Syntax

grep'word' filename
grep'string1 string2'  filename
cat otherfile | grep'something'
command | grep'something'
command option1 | grep'data'
grep --color 'data' fileName

* Way To Search File With grep Command :

Search /etc/passwd for boo user:
$ grep boo /etc/passwd

User can force grep to ignore word case. Such as, match boo, Boo, BOO and another combination with -i option:
$ grep -i "boo" /etc/passwd read more