- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- a problem about find command
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
Forums
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
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
11-09-2006 01:19 PM
11-09-2006 01:19 PM
a problem about find command
but I do not want to search in /tmp/test.
how can i do,thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2006 01:45 PM
11-09-2006 01:45 PM
Re: a problem about find command
# find /tmp -type f ! -path "/tmp/test/*"
This will recursively search '/tmp' returning all files but those in '/tmp/test'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2006 01:48 PM
11-09-2006 01:48 PM
Re: a problem about find command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2006 02:49 PM
11-09-2006 02:49 PM
Re: a problem about find command
find /tmp -name 'XYZ' | grep -v '^\/tmp\/test'
Replace XYZ with the filename you want to search.
Use wildcard if reqd (i.e use 'a*' for finding files starting with 'a', note the single quote while using wildcard).
Searching for a string STRING in those files, use:
grep STRING `find /tmp -name 'XYZ' | grep -v '^\/tmp\/test'`
- Biswajit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2006 07:31 PM
11-09-2006 07:31 PM
Re: a problem about find command
The exact switch to use with find command to exclude directories is;
find /tmp -name test-prune -o -print
where,
-prune = Does not examine any directories or files in the directory structure below the pattern just matched
HTH,
Prabu.S