Operating System - Tru64 Unix
1752801 Members
5309 Online
108789 Solutions
New Discussion юеВ

Re: FIND command..stop it from processing sub-dirs

 
SOLVED
Go to solution
OFC_EDM
Respected Contributor

Re: FIND command..stop it from processing sub-dirs

I believe this is now working....

root > find /loc/A/* -prune ! -type d ! -newer /tmp/june3.ref -exec ls {} \;

I put the /* after the pathname
And reorderd the options.

Here are 3 lines of the output. But I had hundreds of lines and none (verified with grep) had files in any subdirectories.

/loc/A/54482.log
/loc/A/54484.lis
/loc/A/54484.log

Anyone see any potential flaws with this?

Cheers
The Devil is in the detail.
James R. Ferguson
Acclaimed Contributor

Re: FIND command..stop it from processing sub-dirs

Hi (again) Kevein:

> Thanks James but the -path option doesn't appear to be valid for Tru64.

Well, this is the *HP-UX* formum! You should have posted this in the Tru64 UNIX family:

http://forums11.itrc.hp.com/service/forums/familyhome.do?familyId=280

You can ask to have it moved, here:

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1236703

Regards!

...JRF...
OFC_EDM
Respected Contributor

Re: FIND command..stop it from processing sub-dirs

I've requested this thread be moved.

Thanks
The Devil is in the detail.
Laurent Menase
Honored Contributor

Re: FIND command..stop it from processing sub-dirs

Why do I put ! -name A ?

because you made the following request:
find /loc/A ! -newer /tmp/june3.ref -type f -exec ls -l {} \;

If you avoid all what I made the first directory encountered is A; so the -prune avoid to continue. and it will display nothing

When you make it from . it is different as we are already in the current directory, so - prune don't cut the display.

Why I didn't use find /loc/A/* -prune ! -type d ! -newer /tmp/june3.ref -exec ls {} \;

because if I have hidden files begining with a "." then they will not be seen.
OFC_EDM
Respected Contributor

Re: FIND command..stop it from processing sub-dirs

I got it working.
Thanks for the help.

I got onto other things. I'll post what I did once I find that darn command I used.
The Devil is in the detail.