Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
    
thanks a lot for ur immediate help.. –  Dinesh Kumar Dec 15 '10 at 17:07
add comment

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)

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". –  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
add comment

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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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