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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find only returns .

Status
Not open for further replies.
Oct 6, 2002
60
US
Hello experts,

I am having trouble with a simple find command. I am using the command line below to find all files in the current dir (without searching sub dir's) that do not have a name like s0998* but all find returns is a "." does anyone have any suggestions on why this is not working as expected.

find . ! -name "s0998*" -prune -print |more
 
I just tried it but with the same result. Thanks for the suggestion
 
Have you tried missing out the -prune?

Well, that's what my nurse used to tell me!!!
 
And what about this ?
find . \( ! -name . -a -prune \) ! -name "s0998*" | more

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
BRILLIANT PHV !!!! it worked perfectly, thanks so much. I am still a little confused as to why it works????? could you post the english version of this command, I can look up the flags but I don't understand what the Parentheses are used for. Thanks again

Ryan
 
Hey, good question !
You may try this:
find . ! -name . -prune ! -name "s0998*" | more

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top