disk space occupied by a directory in unix

Posted on 2003-03-17
Medium Priority
Last Modified: 2012-06-27
How to know the disk space occupied by a directory in unix?
Question by:prasen120998
LVL 31

Expert Comment

ID: 8152966
In Linux the command is du , it may work in Unix too.


Accepted Solution

sppalser earned 150 total points
ID: 8160086
Almost all the unices I have seen have the du command available.  For example:

     # du -s /usr/home_directory
     72928 /usr/home_directory

shows there are 72,928  512-byte blocks used for approx. 36.5MB.

     # du -sk /usr/home_directory
     37026 /usr/home_directory

shows there are 37,026 1024-byte blocks used for approx. 37.0MB

I believe the difference in the output of the two has to do with the way the -k switch shows overhead.  But for a general idea on your disk usage du works great.  You may want to check your man pages on the option switches that are available with your flavor of unix/linux.

Good Luck


Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Occasionally Windows/Microsoft Updates will fail to update. We have found a code that will delete all temporary files and re-register all dll's related to Windows/Microsoft Updates! This works 99% of the time to get the updates working again! The…
I have written articles previously comparing SARDU and YUMI.  I also included a couple of lines about Easy2boot (easy2boot.com).  I have now been using, and enjoying easy2boot as my sole multiboot utility for some years and realize that it deserves …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question