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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Introduction Often we come across situations wherein our batch files would be needing to reboot Windows for a variety of reasons. A few of them would be like: (1) Setup files have been updated whose changes can take effect only after a reboot …
Sometimes a user will call me frantically, explaining that something has gone wrong and they have tried everything (read - they have messed it up more and now need someone to clean up) and it still does no good, can I help them?!  Usually the standa…
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.

777 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