What's a single command I can run that shows me the total amount of space free on a hard drive? I don't want to do any math, I just want a command that shows me the total free space on my hard drive.
You can use df with the total flag
produce a grand total
df --total -h
for human readable output (i.e K,M,G)
This wil produce output such as
Filesystem Size Used Avail Use% Mounted on /dev/sda2 23G 13G 8.7G 60% / udev 4.0G 124K 4.0G 1% /dev tmpfs 4.0G 72K 4.0G 1% /dev/shm total 31G 13G 17G 44%
To only show the total for physical harddisk space(including nfs)
df -x tmpfs --total -h Filesystem Size Used Avail Use% Mounted on /dev/sda2 23G 13G 8.7G 60% / total 23G 13G 8.7G 60%
Depending on which filetypes you want to exlude (as udev appears to be able to be either
devtmpfs) you can use
df -T Filesystem Type 1K-blocks Used Available Use% Mounted on /dev/sda2 ext3 23731644 13486576 9039564 60% / udev tmpfs 4093900 124 4093776 1% /dev tmpfs tmpfs 4093900 72 4093828 1% /dev/shm ^ This column
To check the filetypes and then just put the required ones into the
Also note that all of these are GNU extensions so you require GNU df.
You can use the
$ df -h Filesystem Size Used Avail Use% Mounted on udev 3.9G 0 3.9G 0% /dev tmpfs 799M 8.7M 790M 2% /run /dev/xvda1 50G 6.3G 41G 14% / tmpfs 3.9G 0 3.9G 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup cgmfs 100K 0 100K 0% /run/cgmanager/fs tmpfs 799M 0 799M 0% /run/user/1000
/dev/xvda1 is my main disk, and it has 41 GB free.
You can also limit the output to only a specific disk or directory:
$ df -h / Filesystem Size Used Avail Use% Mounted on /dev/xvda1 50G 6.3G 41G 14% /
df -h for "human readable" sizes) shows you the filesystem devices, how big are they, how much is used, how much is available, and their mount points in the system.
Take a look here if you want to see some more console commands in your Linux Mint.
You can use
pydf. It's an improved version of
It produces an output like this:
Filesystem Size Used Avail Use% Mounted on /dev/sdb5 92G 16G 70G 17.9 [##...........] / /dev/sdb6 347G 31G 298G 9.0 [#............] /home