Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Instead, it returns the following error:

find: paths must precede expression: file1.log
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
d41d8cd98f00b204e9800998ecf8427e  -

Is there something wrong with the command syntax?

(encountered this problem upon trying the accepted answer of this stackoverflow question)

share|improve this question
3  
'*' is expanded by shell before it is given to find command, see mpi-sb.mpg.de/departments/rg1/teaching/unixffb-ss98/… Thus quote it. –  Jiri Xichtkniha Oct 11 '13 at 11:11
    
Thanks, fixed it by enclosing the pattern in single quotations. –  silvernightstar Oct 11 '13 at 11:12
    
@silvernightstar While you should generally wait a while before accepting an answer (to allow for people from other time zones to offer answers), do consider upvoting and accepting Jiri Xhichtkniha's answer if you feel the question has been answered to your satisfaction. –  Michael Kjörling Oct 11 '13 at 12:44
add comment

1 Answer

up vote 5 down vote accepted

* is expanded by shell before it is given to find command, see A Guide to Unix Shell Quoting. Thus it has to be quoted; use '*' instead.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.