[H-GEN] Re: National Installfest.

Martin Pool mbp at wistful.humbug.org.au
Wed Jul 1 02:53:05 EDT 1998


On Wed, Jul 01, 1998 at 04:02:42PM +1000, Luke Grant wrote:
> 
> Hi ppl,
> 	One of the guys here at work has just asked me a question which i
> am quite sure is dead simple but i have no idea how to do. How can i ask
> for the line number of a grep from a file.

  looz# grep --help
  [thwoc]
 
  Output control:
    -b, --byte-offset         print the byte offset with output lines
    -n, --line-number         print line number with output lines
    -H, --with-filename       print the filename for each match
    -h, --no-filename         suppress the prefixing filename on ouput
    -q, --quiet, --silent     suppress all normal output
    -L, --files-without-match only print FILE names containing no match
    -l, --files-with-matches  only print FILE names containing matches
    -c, --count               only print a count of matching lines per FILE

  [snick]
  looz# grep -n localhost /etc/hosts
  1:127.0.0.1	localhost	localhost.localdomain
  looz#

--
Martin




More information about the General mailing list