I am new to Linux and going through some tutorials and samples. I created a file called test
and put alex
and alexander
in it. I'm trying to find instances of just alex
.
If I do grep alex *
I get the error:
grep: find: Is a directory.
If I do cat test | grep alex
then I get (as expected)
alex alexander (with alex in red)
Why does the first cause an error, and the second produce expected results?
No comments:
Post a Comment