Tech stuff and info dump

How to tell how much disk space is left: linux

May 31st, 2010

Open a terminal (Applications -> Accessories -> Terminal in Ubuntu 10.04 and others) and type

df

at the command line.

Something like this will be displayed:

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda6 83657080 25098664 54308828 32% /
none 504088 296 503792 1% /dev
none 508500 372 508128 1% /dev/shm
none 508500 96 508404 1% /var/run
none 508500 0 508500 0% /var/lock
none 508500 0 508500 0% /lib/init/rw

The number listed on the top line (/dev/sda6) under ‘Available’ is the amount of space left on my linux partition.

For more human-readable numbers, try:

df -h

which will display something like this:

Filesystem Size Used Avail Use% Mounted on
/dev/sda6 80G 24G 52G 32% /
none 493M 296K 492M 1% /dev
none 497M 372K 497M 1% /dev/shm
none 497M 96K 497M 1% /var/run
none 497M 0 497M 0% /var/lock
none 497M 0 497M 0% /lib/init/rw

The df command won’t show space available on unmounted drives.

If you want to see basic information about the partitions on a machine, see this post.


Filed under: Command line,linux
May 31st, 2010 10:58:03