grep in Linux

March 23, 2017

On Linux the grep is slightly different compared to AIX.

Look at this error: I want to get the word "Wants" out of all the files in the directory:

 

root@lnx00031 system# grep Wants *

grep: invalid option — '.'

Usage: grep [OPTION]… PATTERN [FILE]…

Try 'grep –help' for more information.

 

The solution is this: add a — :

root@lnx00031 system# grep — Wants *

 

to disable notifies of the " Is a directory " kind::

root@lnx00031 system# grep -s — Wants *

 

 

Comments are closed.