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.

link|improve this question

80% accept rate
thanks a lot for ur immediate help.. – Dinesh Kumar Dec 15 '10 at 17:07
feedback

migrated from stackoverflow.com Dec 16 '10 at 2:41

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

3 Answers

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 serverfault.com or superuser.com question)

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

Try this:

du --bytes /home

If you really just want the number:

du --bytes -s /home|cut -f 1
link|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
feedback

Not a direct answer to your question, but I always like kdirstat for space issues. I'm just a visual guy.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.