# How to interpret the output of the df -H and df -h commands



## Lasse (Oct 20, 2010)

Which of these outputs should I refer to when I want to know how many gigabytes (*not gibibytes*) of free diskspace I've got?
This: 
	
	



```
$ df -H
Filesystem      Size    Used   Avail Capacity  Mounted on
/dev/ad10s3a    520M    293M    186M    61%    /
devfs           1.0k    1.0k      0B   100%    /dev
/dev/ad10s3e    520M    4.5M    474M     1%    /tmp
/dev/ad10s3f    390G    7.7G    351G     2%    /usr
/dev/ad10s3d    5.2G    158M    4.6G     3%    /var
linprocfs       4.1k    4.1k      0B   100%    /usr/compat/linux/proc
```
or this: 
	
	



```
$ df -h
Filesystem      Size    Used   Avail Capacity  Mounted on
/dev/ad10s3a    496M    279M    177M    61%    /
devfs           1.0K    1.0K      0B   100%    /dev
/dev/ad10s3e    496M    4.4M    452M     1%    /tmp
/dev/ad10s3f    363G    7.4G    327G     2%    /usr
/dev/ad10s3d    4.8G    151M    4.3G     3%    /var
linprocfs       4.0K    4.0K      0B   100%    /usr/compat/linux/proc
```
Thanks in advance/
Lasse


----------



## kaba (Oct 20, 2010)

df -g ?


----------



## vdvluc (Oct 20, 2010)

You should look at the Avail column.
For file systems smaller than 1 GB it is better to use -h, since -g outputs 0 for those file systems.

```
# df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/ad4s1a    496M    253M    203M    55%    /
devfs          1.0K    1.0K      0B   100%    /dev
/dev/ad4s1g    220G     46G    156G    23%    /mnt/nfs
/dev/ad4s1e    365M     12K    336M     0%    /tmp
/dev/ad4s1f    1.9G    147M    1.6G     8%    /usr
/dev/ad4s1d    688M    966K    632M     0%    /var
```


```
# df -g
Filesystem  1G-blocks Used Avail Capacity  Mounted on
/dev/ad4s1a         0    0     0    55%    /
devfs               0    0     0   100%    /dev
/dev/ad4s1g       220   46   156    23%    /mnt/nfs
/dev/ad4s1e         0    0     0     0%    /tmp
/dev/ad4s1f         1    0     1     8%    /usr
/dev/ad4s1d         0    0     0     0%    /var
```


----------



## fronclynne (Oct 21, 2010)

Well, according to df(1) -H is for base 10 and -h is for base 2.  If that doesn't adequately answer your question, then I am stymied.


----------

