Are there any way to see how much space is used for Ubuntu?

I can see how much space using in Windows, since Ubuntu uses root concept, there is no particular hard drive any more. How can I tell how much space left using Ubuntu?


Command line

df -h

Example:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        46G  5,5G   38G  13% /
none            4,0K     0  4,0K   0% /sys/fs/cgroup
udev            2,0G  4,0K  2,0G   1% /dev
tmpfs           404M  1,3M  403M   1% /run
none            5,0M     0  5,0M   0% /run/lock
none            2,0G   23M  2,0G   2% /run/shm
none            100M   40K  100M   1% /run/user
/dev/sda6        23G  275M   22G   2% /home
/dev/sda7       289G   63M  274G   1% /data

Desktop

Search in dash for "system" and choose "system monitor":

enter image description here


The problem with the other solutions is that they also list the files your have created and not only the space used by installed programs. For that I use something rather complex:

dpkg-query -W -f='${Installed-Size;8}' | xargs  | sed -e 's/\ /+/g' | bc

So, what's this supposed to do?

  • dpkg-query -W -f='${Installed-Size;8}' shows the size in Kibibytes of all installed packages.
  • xargs is to prevent that the next sed is applied to the last line.
  • sed -e 's/\ /+/g' replace any instance of space character with the plus sign
  • bc is a command line calculator. It takes 1234 + 12345 from the stdin and returns the result.

References:

  • https://stackoverflow.com/a/18355142/792066 (in the xargs/sed/bc command)
  • https://askubuntu.com/a/373502/169736 for the dpkg query

You can use the dedicated application called "Disk Usage Analyzer":

enter image description here