Recursion search file content in Linux

grep --color=auto -nH 'DIR' *

-n, --line-number

Prefix each line of output with the 1-based line number within its input file. (-n is specified by POSIX.)

-H, --with-filename

Print the file name for each match. This is the default when there is more than one file to search.

*, file path

Published: May 28 2015

blog comments powered by Disqus