Unix Basic Commands - Grep
Unix Basic Commands - Grep
The grep command allows you to search one file or multiple files for lines that contain a
pattern. Exit status is 0 if matches were found, 1 if no matches were found, and 2 if errors
occurred.
SYNTAX
The syntax for the grep command is:
grep [options] pattern [files]
OPTIONS
Option
Description
-b
-c
-h
-i
-l
-n
-s
Silent mode.
-v
-w
EXAMPLE
grep -c tech file1
* Please note that there are many flavors of UNIX, so if in doubt, consult your man pages