- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Excluding multiple directories & files using FIND ...
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
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
тАО10-10-2005 10:48 AM
тАО10-10-2005 10:48 AM
Excluding multiple directories & files using FIND command
I am trying to use the find command and exclude multiple directories and files.
So can you suggest me the syntax of excluding multiple directories and files using the find command
help is appreciated.
Thanks
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2005 10:50 AM
тАО10-10-2005 10:50 AM
Re: Excluding multiple directories & files using FIND command
will walk through entire file system except for /dev and /tmp
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2005 10:51 AM
тАО10-10-2005 10:51 AM
Re: Excluding multiple directories & files using FIND command
find / ! \( -name "core" -name "*.c" \) -print
This will exclude files named "core" or ending with .c.
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2005 05:29 PM
тАО10-10-2005 05:29 PM
Re: Excluding multiple directories & files using FIND command
you can use the find command with following option to exclude directories;
find . -name $DIRNAME -prune -o -print
where, $DIRNAME is the name of the directory to be excluded.
HTH,
Prabu.S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2005 05:34 PM
тАО10-10-2005 05:34 PM
Re: Excluding multiple directories & files using FIND command
find / -type d \( -name DIR1 -o -name DIR2 -o -name DIR3 \) -prune -o
-type d -print
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2005 06:38 AM
тАО10-12-2005 06:38 AM
Re: Excluding multiple directories & files using FIND command
I want to backup filesystems /a /b and /d.
I want to skip filesystem /c, and directories: /a/skip1, /b/notthis.
find /a /b /d -print | grep -Ev "^\/a\/skip1|^\/b\/notthis" > answer.txt
Or....
find /a /b /d -print > bigfile
cat bigfile | grep -Ev "^\/a\/skip1|^\/b\/notthis" > answer.txt
Or...
find / -print > bigfile
cat bigfile | grep -Ev "^\/c|...blah blah.."
^ ==== anchor search to beginning of string.
\/ === really search for a forward slash.
| ==== the OR command.