De man grep
(grifo meu):
grep searches the named input FILEs (or standard input if no files are
named, or if a single hyphen-minus (-) is given as file name) for lines
containing a match to the given PATTERN. By default, grep prints the
matching lines.
Se você executou grep
sem um nome de arquivo ou um canal (o |
in ls | grep
):
grep foo
A entrada padrão é o terminal - isto é, você. Você precisa fornecer a entrada que grep
pesquisará.
$ grep foo
this is me typing stuff
now I'm typing foo, which will get printed again because grep matched foo
now I'm typing foo, which will get printed again because grep matched foo