Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The find command is a pain!

Status
Not open for further replies.

womp

Technical User
Apr 6, 2001
105
US
Please explain this if you know
I do a search command that looks like this:
find / -name *connector*
I receive results like this:
find: changed during execution of find
This does not only happen when I use '*'
It seems to happen whenever I do the find command
Does anyone know why???
 
Doublequotes do also, or escaping each * with a \.

find accepts *one* argument to -name, if you have multiple files matching *something*, they get expanded by your shell before the command is run, so you end up with wrong arguments.. if you have just one file matching, then this will appear instead *something*, which is not wanted also.

. Mac for productivity
.. Linux for developement
... Windows for solitaire
 
In other words, the wildcards are meant for [tt]find[/tt], not the shell. So quote them so they get to [tt]find[/tt] without the shell trying to expand them.
 
Personally, i use locate . run a cron job to update the database every night and you're pretty much good to go.

_____________________________
when someone asks for your username and password, and much *clickely clickely* is happening in the background, know enough that you should be worried.
 
find / -name "*connector*"

or

find / -name "*connector*" -type f | xargs ls -l
 
find / -name '*conn*' -print0 | xargs -0n 5000 ls -lF

. Mac for productivity
.. Linux for developement
... Windows for solitaire
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top