- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- du 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
02-10-2006 02:07 AM
02-10-2006 02:07 AM
I'm trying to retreive files and there sizes using du -a -k which works to well. It goes down the whole folder tree to the smallest file. Is there away to have it stop at the last folder and report the size at that point?
Thanks,
Conrad
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2006 02:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2006 02:27 AM
02-10-2006 02:27 AM
Re: du command
Try this
# du -sk * | sort -n Or
# du -sk * | sort -rn
Rgds / James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2006 07:35 AM
02-10-2006 07:35 AM
Re: du command
du -ks * |sort -n
would be solution for you...
Good Luck,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2006 08:16 AM
02-10-2006 08:16 AM
Re: du command
Pete's -x option is the best so far. I now need to find a way to determine if the very first level returned is a directory then to return the files inside it. I may need to stick with the -a option and then take the file into ACCESS or something and force it to group the files that I need. More thought required.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2006 08:22 AM
02-10-2006 08:22 AM
Re: du command
This is what I use:
du -akx | sort -rn | more
This puts the grand total right up top.
Plus shows you the "hogs" up there as well.
HTH,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2006 08:43 AM
02-10-2006 08:43 AM
Re: du command
I like this better. How would you sort the file so that it is done based on the path rather than the size?
Conrad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2006 08:53 AM
02-10-2006 08:53 AM
Re: du command
To use Jeff's suggestion but sort the output using the filename (the second field), simply do:
# du -akx | sort -k2 | more
See the 'sort' manpages for more information.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2006 08:57 AM
02-10-2006 08:57 AM
Re: du command
du -akx | sort -rn | sort -k 2,2 | more
This will sort second field - i.e. path & THEN the size within.
Flip those around & you'll get size then path.
HTH,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2006 04:31 AM
02-13-2006 04:31 AM