Grep, great linux command, funny issue…

If you execute the command like this: grep test *
and then get this back:

grep: unknown directories method

or

grep: invalid option -- t

This happens when there is a file in the local directory that has a name that starts with a “-”, for exampe “-directory.xml” or “-otherfile.txt.”
remove the file with: rm -i ./-directory.xml

Be Sociable, Share!
    Categories: linux
    post | Comments Off June 2, 2010

    Comments are closed.