- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- find command and prune
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2006 06:07 AM - last edited on 03-30-2015 08:11 PM by Maiko-I
03-22-2006 06:07 AM - last edited on 03-30-2015 08:11 PM by Maiko-I
This is on hp-ux 11.0
I need to run find and exclude NFS, CDFS as well as a few directories. I have the following command but it does not exclude dir1 nor dir2, why is that?
find / \( -fstype nfs -o -fstype cdfs -o -path /dir1 -o -path /dir2 \) -prune -print
P.S. This thread has been moved from HP-UX > System Administration to HP-UX > Languages. - Hp Forum Moderator
Solved! Go to Solution.
- Tags:
- find
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2006 06:12 AM
03-22-2006 06:12 AM
Re: find command and prune
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2006 06:16 AM
03-22-2006 06:16 AM
Re: find command and prune
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2006 06:17 AM
03-22-2006 06:17 AM
Re: find command and prune
The way that's written, it's only going to find those paths.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2006 06:56 AM
03-22-2006 06:56 AM
Re: find command and prune
What can be done to fix it?
find / ! \( -fstype nfs -o -fstype cdfs -o -name /dir1 -o -name /dir2 \) -print
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2006 07:04 AM
03-22-2006 07:04 AM
Re: find command and prune
prune does not exclude, try the not operator instead, e.g.:
# find / -type f \( ! -fstype nfs ! -fstype cdfs ! -path "/dir1/*" ! -path "/dir2/*" \)
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2006 07:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2006 08:35 AM
03-22-2006 08:35 AM
Re: find command and prune
find / \( -fstype nfs -o -fstype cdfs -o -path /dir1 -o -path /dir2 \) -prune -o -print
Same as what you had before, only put "-o" between -prune and -print.
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 01:33 AM
03-23-2006 01:33 AM
Re: find command and prune
This one worked, thank you. Turns out you don't need prune. Still a mystery to me why prune didn't work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2015 12:05 PM
03-27-2015 12:05 PM
Re: find command and prune
Why not just do:
find / -fsonly vxfs -name FILENAME
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2015 09:25 AM
03-31-2015 09:25 AM
Re: find command and -prune
>Why not just do: find / -fsonly vxfs -name FILENAME
That won't exclude those two directory paths.
>Turns out you don't need -prune.
-prune is needed so you don't keep finding (and excluding) files under the highest directory possible.