What does "paths must precede expression" mean when using find?
By Michael Henderson •
I want show all the files that have a .bak extension.
kaykav@ubu2:~/Documents$ ls
cdIndex1-60 met.bak tem.bakI type the cmd : $ find . -name *.bak
I'm in the correct Directory for this. I get the following message:
find: paths must precede expression: tem.bak
What does that mean? Man pages are no help.
11 Answer
Try putting it in quotes:
find . -name '*.bak'
When you simply use find . -name *.bak in that directory shell expands it to find . -name tem.bak met.bak (i.e. interprets * as the wildcard)