Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to quickly check the amount of free / used disk space in Ubuntu?

I would assume you could right click on 'file system' in the file browser and choose 'properties' or something but there is no such option.

share|improve this question
    
Simply use free command – shivaraj Jan 27 at 1:49

12 Answers 12

up vote 242 down vote accepted

Open System Monitor from Dash and select the Filesystems tab.

enter image description here

Or alternatively open a Terminal and type:

df -h
share|improve this answer
4  
thanks! got me what i need. But it is kind of a bummer that there's no intuitive way to check the hd usage. I imagine most people would get frustrated trying to figure it out. – greg Oct 28 '11 at 21:11
4  
Well. Every time you are in a folder in nautilus, it says at the bottom how much space is left on the device. – Elvis Stressborg Nov 2 '11 at 23:15
2  
@greg: Actually, it isn't as straightforward as you might think, since the UNIX way of mounting filesystems means that any folder's contents can potentially exist on different disks or partitions. Thus, any method of checking free space must explicitly account for this. – Scott Severance Nov 3 '11 at 3:17
13  
df -h --total – nutty about natty Mar 10 '13 at 14:22
3  
df for used and free space in bytes, df -m for space in units of 1MB, df -h for largest available unit. You will also get % usage, it remains same with all the above though. – Fr0zenFyr Jan 17 '14 at 4:45

Simply you can find available free space using free command .. Here you can get clear explanation about free command usage

using "free" command to find free space available on Linux

share|improve this answer

You can use baobab, or similar tools such as kdirstat or filelight, to see what files are using up your disk space.

Baobab is also called Disk Usage Analyzer on Ubuntu.

Here's a sample screenshot of baobab:

baobab

For a command line option, I prefer to use ncdu:

ncdu

You can drill into sub-folders to get total relative disk usage on the sub-folders. It's turtles all the way down. More nifty than du -sh on remote machines.

share|improve this answer
    
Was not aware of ncdu until now. VERY useful program. I went from issuing du -sk * | sort -n to using ncdu. While I do enjoy being able to issue a few handy commands in a terminal or even making aliases out of them, no sense reinventing the wheel. – Tass Mar 21 at 14:57
    
Enableing now, only v1.8 though :( – Jamie Hutber Apr 15 at 9:59

Free/used disk space is always related to a partition.

First you need to decide which partition you are interested in.

root@pc:~# df -h
Filesystem             Size  Used Avail Use% Mounted on
/dev/sda1               28G   26G  643M  98% /
none                   4.0K     0  4.0K   0% /sys/fs/cgroup
udev                   3.9G  4.0K  3.9G   1% /dev
tmpfs                  790M  1.5M  789M   1% /run
none                   5.0M     0  5.0M   0% /run/lock
none                   3.9G  156K  3.9G   1% /run/shm
none                   100M   72K  100M   1% /run/user
/dev/sda6              887G  685G  158G  82% /home
//fritz.box/fritz.nas  917G  596G  322G  65% /media/fritzbox

In my case I am interested in the / since it has 98% in use. In other words it is nearly full.

Now I use this command to see which files and directories contain the most bytes:

root@pc:~# du -ax / | sort -rn > /var/tmp/du-root-$(date --iso).log

Above command can take some time. If you are really unlucky the result is too big for /var/tmp. Then you need an other destination. Maybe a temporary mounted usb memory stick.

Here are the first lines of my result:

root@pc:~# less /var/tmp/du-root-$(date --iso).log
26692380        /
9875188 /usr
8931652 /var
4057324 /var/log
4038176 /var/log/bootchart
3784016 /usr/share
2934248 /lib
2799204 /usr/lib
2785176 /lib/modules
2617048 /var/lib
2141124 /usr/src
1834444 /var/lib/docker
1817372 /var/lib/docker/aufs
1817076 /var/lib/docker/aufs/diff
1769612 /localhome
1338484 /tmp

Why is /var/log/bootchart that big? .... That is an other question, since this question is about how to find the used disk space.

share|improve this answer

In lubuntu you can do as follows:

1- Start Button > Accessories > Disks

2- Start Button > Preferences > Disks

enter image description here

share|improve this answer

Another way! Right click on computer in Nautilus (file explorer) and click properties. It displays how much free and used space is on your hard drive. enter image description here

share|improve this answer

I am not a filesystem pro, but I would like to clarify a minor difference between

lsblk

and

df -h

lsblk : display mounted and unmounted disk

df -h : display mounted disk only

share|improve this answer

I wrote a little hack for this with a command line and gui version. It's rather hard-coded, so may need some tweaks. Also, the gui version appears to use a proportional font that messes up the alignment of the displayed output. These scripts could be put in your path somewhere (like in $HOME/bin) and you can create an icon for the gui script on your desktop or panel.

#!/bin/bash
## jdf - Copyleft 04/25/2009 - JPmicrosystems - GPL
## Free space on disk
## Custom df output
## Human readable (-h)
## sorted by file system name

## Make a temporary file and put the following awk program in it
AWK=$(/bin/mktemp -q /tmp/jdf.XXXXXX)

## PROG is quoted to prevent all shell expansions
## in the awk program
cat <<'PROG' > ${AWK}
## Won't work if mount points are longer than 21 characters

BEGIN {
  ## Use fixed length fields to avoid problems with
  ## mount point or file system names with embedded blanks
  FIELDWIDTHS = "11 11 6 6 5 5 21"
  printf "\n%s\n\n", "                    Available Disk Space"
  printf     "%s\n", "Mount Point          Avail Size  Used  Use%  Filesystem Type"
}

## Eliminate some filesystems
## That are usually not of interest
## anything not starting with a /

! /^\// { next }

## Rearrange the columns and print

{
  TYP=$2
  gsub("^ *", "", TYP)
  printf "%-21s%6s%6s%5s%5s %s%s\n", $7, $5, $3, $4, $6, $1, TYP
}

END { print "" }
PROG

df -hT | tail -n +2 | sort | gawk -f ${AWK}

rm -f ${AWK}

Sample output:

                   Available Disk Space

Mount Point          Avail Size  Used  Use%  Filesystem Type
/                      22G  30G  6.6G   24%  /dev/sda6  ext4    
/media/dataspace       44G 155G  105G   71%  /dev/sda8  ext3    
/home                 5.5G  32G   25G   82%  /dev/sda9  ext3    

Gui version:

#!/bin/bash
jdf | zenity  --title "Available Disk Space" --text-info --width=500 --height=300 --timeout=60

New Gui Version with fonts fixed using yad

#!/bin/bash

jdf | yad  --fontname="DejaVu Sans Mono 12" --title "Available Disk Space" --text-info --width=650 --height=300
share|improve this answer

Type in disk usage analyzer in dash.

share|improve this answer
3  
Please elaborate your answer. – green Apr 19 '13 at 7:28
    
Disk Usage Analyzer in the Ubuntu dashboard refers to the baobab command that you can access from the terminal. – Ehtesh Choudhury Jun 7 '13 at 0:57
    
How differs your answer from this one? askubuntu.com/a/305057/42348 – guettli Dec 6 '15 at 12:11

There are a number of ways to do this.

  • Enable the status bar in the View menu in Nautilus. This will place a bar at the bottom of all nautilus windows telling you the free space.

  • Use the File Systems System Monitor to view a list of all disks and their free space.

  • Use the Disk Usage Analyzer to get a listing of all directories on your system and how much free space they take up.

  • Go to any folder in nautilus and right click the background. Open the properties window to check the free space.

  • Run the command df -h.

share|improve this answer
    
+1 for the status bar! – greg Oct 28 '11 at 21:11

Using dconf-editor or gsettings (sudo apt-get install dconf-tools) you can enable the default behavior of the status bar.

Type this on your terminal to enable the status bar by default

gsettings set org.gnome.nautilus.window-state start-with-status-bar true

Type this on your terminal to disable the status bar by default

gsettings set org.gnome.nautilus.window-state start-with-status-bar false

After that you will have the statusbar opened by default on Nautilus, no need to run anything else.

share|improve this answer

gnome-system-monitor or df -h or lsblk

Other useful utilities are baobab.

share|improve this answer
9  
+1 for baobab. – user606723 Oct 28 '11 at 16:11
    
Agree with user606723. Cool utility baobab :) – Dhaval Jan 9 '14 at 11:06

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.