- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- inconsistent find behavior
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
тАО02-09-2009 09:24 AM
тАО02-09-2009 09:24 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-09-2009 09:29 AM
тАО02-09-2009 09:29 AM
SolutionIf you want _files_ only, you need to say-so:
# find . -type f -size +1000000c -exec ls -l {} +
...will perform the 'ls' on the list which consists of FILES only and not files AND DIRECTORIES.
Note, too, that you will gain performance by using the "+' terminator with the '-exec'. THis bundles many arguements together and presents them en mass to 'ls' rather than spawning one 'ls' process for every file found!
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-09-2009 01:44 PM
тАО02-09-2009 01:44 PM
Re: inconsistent find behavior
I usually do the same with:
$> find . -size +1000000c | xargs -i ls -ald {}
Of course, that does what James suggested except it uses xargs to handle the "bunching".
James' solution is nicer in that it doesn't require a middle process spawned to handle bunching. Except, that when I'm looking for large things, I also just don't worry about whether its a file or not, because I also want to know about large single directories which exist on the system, which are performance bottlenecks. Yes, I've found directories from programs/programmers with 800,000 files in them... sigh - usually after the programmer wonders why "he can't list" all of the files. He can, put it's painfully slow...
Anyways, another way to do it and incorporate James' cool suggestion (which I didn't know about):
$> find . -size +1000000c -exec ls -al {} +
P.S. Anybody else confused that find -exec doesn't seem to want/need/accept the trailing "\;" anylonger? Or, am I thinking of something else???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-09-2009 01:46 PM
тАО02-09-2009 01:46 PM
Re: inconsistent find behavior
BTW, I just realized I didn't explain -the trailing "d" in "ls -ald" tells ls *not* to expand the subdirectories for you.
No points for this post, or the prior mistaken double-post.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-09-2009 01:51 PM
тАО02-09-2009 01:51 PM
Re: inconsistent find behavior
> TwoProc: Anybody else confused that find -exec doesn't seem to want/need/accept the trailing "\;" anylonger?
When you use the semicolon as a terminator to '-exec's arguments you must escape it with the back-slash to prevent the shell from interpreting it. That is, ";" is special to the shell; the "+" isn't.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-09-2009 02:23 PM
тАО02-09-2009 02:23 PM
Re: inconsistent find behavior
Anyway, it's supposed to be:
$> find . -size +10000000c -exec ls -ald +
not
$> find . -size +10000000c -exec ls -al +
...
Geez, I only WISH I could mess up *more* postings today!!! UUUGH!