- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Finding a file .. and not knowing what dir.
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
04-24-2001 05:31 AM
04-24-2001 05:31 AM
I have ran into a probelm as always.
How would i go about finding a file in HPUX 11.0 with out knowing what dir it is in. It could be anywhere in the box. So I am looking for a good find command. And to top it off it is not just one name of one file but an ext ..
.cm so i know it would be *.cm
thanks
Richard
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2001 05:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2001 05:36 AM
04-24-2001 05:36 AM
Re: Finding a file .. and not knowing what dir.
find / -name *.cm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2001 05:36 AM
04-24-2001 05:36 AM
Re: Finding a file .. and not knowing what dir.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2001 05:39 AM
04-24-2001 05:39 AM
Re: Finding a file .. and not knowing what dir.
Too slow again doh ! ;)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2001 05:40 AM
04-24-2001 05:40 AM
Re: Finding a file .. and not knowing what dir.
find / -name '*.cm' -type f 2> /dev/null
is a good way.
Make sure you quote the *.cm so the shell does not substitute files from the current directory. The -type f will limit the search to regular files. If you are not root, the 2> /dev/null will discard error messages regarding directories you may not search due to a lack of permission.
--Bruce
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2001 08:47 AM
04-24-2001 08:47 AM
Re: Finding a file .. and not knowing what dir.
du -a / | grep "filename$"
Will find your file faster and with far less system overhead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2001 12:35 PM
04-24-2001 12:35 PM
Re: Finding a file .. and not knowing what dir.
I personally don't see that 'du' is actually faster than 'find' in the case Alan cites, above.
On a server with only local filesytems, I've compared the execution times by searching the root directory (/) for files named "hosts". The numbers reported are the average of three separate "loops" of the following commands:
# timex find / -name hosts
# timex du -a / | grep "/hosts$"
In each case on my server, four files matched the criteria selected. The times for 'find' where consistently better than for 'du':
> with 'find': r=37.8, u=1.3, s=11.3
> with 'du': r=45.8, u=2,2, s=14.3
...where r=real (elapsed); u=user; s=system...
...JRF...