Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In unix how to find the space occupied ( in Bytes) by the /home directory including all its subdirectories.

The du command outputs the number of kilobyes used by each subdirectory. Useful if you have gone over quota and you want to find out which directory has the most files. but how shuld i use tat in my case.

share|improve this question

migrated from Dec 16 '10 at 2:41

This question came from our site for professional and enthusiast programmers.

thanks a lot for ur immediate help.. – Dinesh Kumar Dec 15 '10 at 17:07
up vote 3 down vote accepted

du -bs ~ will print out total space in bytes used in your home directory and all of its sub-directories, though you may find du -hs to print friendlier numbers.

See also man du

(also probably a or question)

share|improve this answer
@unhillbilly: OP said "/home directory including all its subdirectories" – thejh Dec 15 '10 at 17:03
-s means "including all subdirectories". – zwol Dec 15 '10 at 17:05
@thejh. My words lie, the command does not. I shall correct. Thank you! – David J. Liszewski Dec 15 '10 at 17:06

Try this:

du --bytes /home

If you really just want the number:

du --bytes -s /home|cut -f 1
share|improve this answer
If you really want just the number, don't you use du --bytes -s /home? – Jonathan Leffler Dec 15 '10 at 17:14
@Jonathan Leffler: You will still need to cut, but yes, the tail was unnecessary. removing it. – thejh Dec 15 '10 at 17:28

Although it doesn't use the command line, I like to use KDirStat to see the usage of space. I'm just a visual guy.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .