- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: 'find' not finding all files using wildcards
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
09-23-2002 09:04 AM
09-23-2002 09:04 AM
find . -name *.htm -exec gzip {} \;
find . -name '*.htm' -exec gzip {} \;
find . -name "*.htm" -exec gzip {} \;
find . \( -name *.htm \) -exec gzip {} \;
find . \( -name '*.htm' \) -exec gzip {} \;
find . \( -name "*.htm" \) -exec gzip {} \;
None of them manages to find all the files in all the directories. They always leave some behind. Why is this?
Thanks,
-Ron Levy
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2002 09:18 AM
09-23-2002 09:18 AM
Re: 'find' not finding all files using wildcards
I would expect the unquoted format (either single or double quotes) to give problems because the shell is going to attempt to expand the filename before 'find' ever sees it.
With the quoted forms, do you expect to have files with any characters following the suffix "htm"? If so, you need to change your find to:
# find . -name '*.htm*'
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2002 09:24 AM
09-23-2002 09:24 AM
Re: 'find' not finding all files using wildcards
Sometimes if I am not sure on what the find command is doing, I'll send the list of filenames to a tempfile. This way I can review the files find has found.
find . -name '*.htm' -print >/tmp/myfind
(your 2nd and 3rd examples are correct)
After checking the file, I then use xargs to process the files.
cat /tmp/myfind | xargs -n1 gzip
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2002 09:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2002 09:57 AM
09-23-2002 09:57 AM
Re: 'find' not finding all files using wildcards
Try this..
find . -name "*.htm" -exec gzip {} \;
Regards,
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2002 10:04 AM
09-23-2002 10:04 AM
Re: 'find' not finding all files using wildcards
Unless I'm missing something, all but your 1st and 4th examples should work. Is it possible some files are being written / closed after you issue the find command?
Harry's example (using xargs) is more performant though.
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2002 10:11 AM
09-23-2002 10:11 AM
Re: 'find' not finding all files using wildcards
(It must have been a quantity problem for xargs to solve it so neatly.)
-Ron Levy