What Does "Paths Must Precede Expression" Mean When Using Find?

What Does "Paths Must Precede Expression" Mean When Using Find?

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.

1

1 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)

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Chloe Bennett
Author

Chloe Bennett

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.