How to get df linux command output always in GB

Aryan picture Aryan · Jun 6, 2013 · Viewed 110.8k times · Source

How to get df linux command output always in GB always? ie. I want below 34MB to be displayed in GBs

Filesystem            Size  Used Avail Use% Mounted on
/ttt/pda1              21G   20G   34M 100% /

How can this be achieved ?

Thanks in advance.

Answer

You can use the -B option.

Man page of df:

-B, --block-size=SIZE use SIZE-byte blocks

All together,

df -BG