Ubuntu: What does “paths must precede expression” mean when using find?



Question:

I want show all the files that have a .bak extension.

kaykav@ubu2:~/Documents$ ls  cdIndex1-60  met.bak  tem.bak  

I 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.


Solution:1

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)


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »