M HYPE SPLASH
// updates

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

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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