Summary: non-helping error output with find
Submitted by: None
Submitted on: Wed 09 Aug 2017 11:12:29 PM UTC
Severity: 3 - Normal
Item Group: None
Assigned to: None
Originator Name: kalle
Originator Email: ka...@projektwerkstatt.de
Discussion Lock: Any
Fixed Release: None
akraum@akraumGI ~/Downloads $ ls
akraum@akraumGI ~/Downloads $ LANG=C find . -name fax* bloc*
find: paths must precede expression: blockadesw.jpg
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec]
This was, what I got by typing two patterns into find-command. The answer
"paths must precede expression" didn't help me any further in understanding
the problem, since my path "." was preceding the expression "-name fax*
How could one know, that options like "-name" can only have one name?
Invoking "man find", it says at the bottom of the page:
$ find . -name *.c -print
find: paths must precede expression
Usage: find [-H] [-L] [-P] [-Olevel] [-D
help|tree|search|stat|rates|opt|exec] [path...] [expression]
This happens because *.c has been expanded by the shell resulting in
find actually receiving a command line like this:
find . -name bigram.c code.c frcode.c locate.c -print
That command is of course not going to work. Instead of doing things
this way, you should enclose the pattern in quotes or escape the wildcard:
$ find . -name \*.c -print"
Here it assumes, that "of course" this will not work. No more explanation.
This is not enough.
Furthermore I don't understand why it gave out to me the file
"blockadesw.jpg". Obviously, it is the first file, to match a pattern.
My version is findutils 4.4.2
Reply to this item at:
Message sent via/by Savannah