- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: determining directory size
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-12-2003 08:59 AM
02-12-2003 08:59 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2003 09:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2003 09:07 AM
02-12-2003 09:07 AM
Re: determining directory size
du -ks /dir_name
If there are mount points under this directory, and you don't want to include anything under those mount points, then use '-x':
du -ksx /dir_name
So, if you set:
sizekb=`du -ksx /dir_name | awk '{print $1}'`
then
let sizemb=sizekb/1024 ; echo $sizemb
will give you the size in Mb.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2003 09:07 AM
02-12-2003 09:07 AM
Re: determining directory size
Do you mean filesystem size, as in a 'mountpoint' when you say "[I want...to create another directory of similiar structure, but don't want to waste any resource"?
Remember, once space (blocks) are allocated for a directory, that is, as files are added to it, the directory's space will never shrink. Therefore, a once-heavily populated, but now empty, directory will consume more space than a freshly made one.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2003 09:08 AM
02-12-2003 09:08 AM
Re: determining directory size
This will report the size in Kbytes. You can then convert it to MBytes by deviding it with 1024.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2003 09:39 AM
02-12-2003 09:39 AM
Re: determining directory size
du -kx /var | sort -rn > /tmp/du.var
Now look at the top lines in /var, u will see larger ones first, example :
/var/mail -- (someone got a giant email)
/var/spool -- (someone is printing a massive file)
/var/adm -- (probably a big logfile)
/var/adm/syslog -- (definitely a big logfile)
/var/adm/sw -- (patches, but cleanup will require space in /var)
/var/tmp -- (someone has a bunch of big files in /var/tmp)
Just to add to above !