next up previous contents
Next: gv - Display PostScript Up: Other Useful Commands Previous: ftp - File transfer   Contents

grep - Search file for character string

Search for one or more strings in one or more files. Examples:-

grep that myfile.txt

Look for the string ``that'' in the file called ``myfile.txt'' and print out each line that matches.

egrep -in "this|that" *.dat

Extended grep search *.dat files for ``this'' or ``that'' case insensitive (-i) and where found print line number (-n) along with the line contents.



P.D. Gronbech (IT Staff) 2015-10-02