Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

So I am new to Ubuntu and Linux in general. I am trying to determing what is taking so much disk space so I run the following command.

du / -h -d 2 | sort -hr

which outputs the following

7.3G    /
5.1G    /var
3.8G    /var/www
1.1G    /usr
635M    /var/lib
573M    /var/cache
570M    /lib
474M    /lib/modules
354M    /usr/share
308M    /usr/src
262M    /usr/lib
135M    /usr/bin
118M    /var/log

What does the first line of output mean? why or how could / (nothing?) be taking up 7gb of space?

share|improve this question
6  
have you noticed if you add up all those values they equal 7.3G? –  zeitue Feb 27 at 5:20
1  
@TaylorBioniks of course you mean all of the 1 level deep values. –  John Chadwick Feb 27 at 7:54
3  
To complement the answers, your error lies in / (nothing?). In fact / contains everything. –  Calimo Feb 27 at 13:00

2 Answers 2

up vote 14 down vote accepted

Everything you see is under / so its the sum up value of everything :P

share|improve this answer
    
Thank you for explain it in diagrammatically i should have explain like this i am sure that this diagram will help any one to understand the scenario. –  smn_onrocks Feb 27 at 5:28
5  
Need to give image citation linuxplanet.com/linuxplanet/tutorials/6666/1 –  user13107 Feb 27 at 7:21
    
Now I feel stupid, thank you for this, makes total sense. –  kisonay Feb 27 at 12:04

The numbers du gives are cumulative. I.e. it's the space taken up by everything in the directory plus everything underneath the directory. The number for / therefore is how much space all the files on the filesystem are taking.

If you don't want cumulative numbers, you can use du -S.

share|improve this answer
    
Understood. I was basically looking to see which root folders had the most space. Thank you for the response. –  kisonay Feb 27 at 12:05
1  
@kisonay For that use Baobab or Filelight, two common disk usage analyzers (there are command line tools too). –  Ramchandra Apte Feb 27 at 15:17

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.