Operating System - HP-UX
1752647 Members
5562 Online
108788 Solutions
New Discussion

HP-UX find command sanity check

 
SOLVED
Go to solution
alc.dtv
Occasional Contributor

HP-UX find command sanity check

Hi all,

 

I would really appreciate it if you fellow board members can give me a sanity check and let me know if my command is correct on my HP-UX 11.23 system.

 

I'm trying to find and show details for all files on my system that are owned by user 250 in group 25 except those in /opt/star/archives and those in /opt/archives.  This is what I'm using:

 

find / -path '/opt/star/archives' -prune -o -path '/opt/archives' -prune -o -user 250 -group 25 -exec ls -l {} \;

 

Thanks in advance!

 

AC

 

 

 P.S.This thread has been moved from HP-UX>System Administration to HP-UX >  langages- HP Forums Moderator

2 REPLIES 2
Dennis Handly
Acclaimed Contributor
Solution

Re: HP-UX find command sanity check

Your -prune logic looks ok but you need to fix your -exec, both for performance and for directories.

... -exec ls -ld {} +

alc.dtv
Occasional Contributor

Re: HP-UX find command sanity check

Great; this thing is working as intended.  Thank you very much!