- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Automatic Disk Usage report
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
05-04-2006 07:10 AM
05-04-2006 07:10 AM
I have a question which I think you guys can help me with.
Weekly I need to create a report which tells me for each directory below /home how much disk space it is occupying in kbs or meg prefer meg if poss)as a whole rather than per file within the home directory.
I know about du and dk but they dont give me the simple number I am looking for - for each directory below home, how much space in megs is it and its sub directores occupying.
As always thanks a million for the help
Mark
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2006 07:13 AM
05-04-2006 07:13 AM
Re: Automatic Disk Usage report
Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2006 07:24 AM
05-04-2006 07:24 AM
Re: Automatic Disk Usage report
du -sk /home/*
Jeff Traigle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2006 07:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2006 08:24 AM
05-04-2006 08:24 AM
Re: Automatic Disk Usage report
Or simply use
find /home -type d | xargs du -sk | awk '{print $NF,$1/1024,"MB"}'
Regards,
Ninad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2006 10:12 AM
05-04-2006 10:12 AM
Re: Automatic Disk Usage report
Rodney's suggestion deserved more merit. A simple:
# du -ks /home/*
...would have summarizied the 1K sizes of every directory in '/home' without spawning multiple processes through a series of pipes.
If you wanted to see the biggest-to-smallest users, just sort it thusly:
# du -ks /home/* | sort -k1nr
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2006 08:10 PM
05-04-2006 08:10 PM
Re: Automatic Disk Usage report
I use this script to get it.
HTH,
Art
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2006 08:12 PM
05-04-2006 08:12 PM
Re: Automatic Disk Usage report
I use this script to get it.
This is another one.
HTH,
Art
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2006 08:20 PM
05-04-2006 08:20 PM
Re: Automatic Disk Usage report
I Guess Mark said that he wants to know usage of all directories under home and its subdirectories. So just du -sk /home/* wont give the usage of the subdirectories.
Regards,
Ninad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2006 05:55 AM
05-05-2006 05:55 AM
Re: Automatic Disk Usage report
Ninad, if Mark wants a summary of each directory beneath '/home' including all subordinate directories, then my suggestion as posted simply becomes:
# du -k /home/*
...and for a list in descending space utilization:
# du -k /home/* | sort -k1nr
...dropping the '-s' switch that causes summarization.
You are correct that the author asked "...how much space...it is and its subdirectories...".
*However*, the top-rated solution actually gives summarized values! As for speed, the suggestion I make ran in about 0.1 wall seconds compared to about 4.5 seconds for the other.
With my regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2006 07:49 AM
05-05-2006 07:49 AM
Re: Automatic Disk Usage report
not files that's why I had to use "find -d"
[...]as a whole rather than per file within the home directory[...]
"-s" option
[...]for each directory below home, how much space in megs is it and its sub directores occupying[..]
Here I think the poster pointed out "subdirectories" to mean he wants the dir in a whole, with its subdir computed.
I made a for cicle to add the cosmetic "dir is n Kb" :)