- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: find files except certain directories
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
Forums
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
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
тАО01-09-2009 12:29 PM
тАО01-09-2009 12:29 PM
If there is a better way than find, then let me know please.
Thanks,
f. halili
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-09-2009 12:54 PM
тАО01-09-2009 12:54 PM
SolutionBy example, do something like this:
# find / -xdev -type f -name "*vg*" ! -path "*lvmconf*"
This uses the '-path' argument to skip reporting the contents of the '/etc/lvmconf' directory's files. You can compare the results with and without '! -path "*lvmconf*" to see.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-09-2009 03:06 PM
тАО01-09-2009 03:06 PM
Re: find files except certain directories
The problem with "! -path" is that it actually stats each file under that path, then excludes it. The optimal option is -prune except there are no good examples on how to use it.
find / -xdev -type f \( -name "*lvmconf*" -prune -o -name "*vg*" \)
Or to find all files except under SUB_E:
find . -xdev \( -name SUB_E -prune -o -type f \) -type f
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2009 04:52 PM
тАО01-10-2009 04:52 PM
Re: find files except certain directories
I would have used the find, then grep'd out the paths I wanted to exclude.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2009 08:10 AM
тАО01-13-2009 08:10 AM