Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get df linux command output always in GB [closed]

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.

like image 600
Aryan Avatar asked Jun 06 '13 12:06

Aryan


People also ask

How do I display df output in GB?

To display information of all file system statistics in GB (Gigabyte) use the option as 'df -h'.

Which command displays the amount of free disk space df?

Use the df command to show the amount of free disk space on each mounted disk.

How do you read df output?

df (disk free) command is used to display disk usage of the file system. By default df command shows the file system usage in 1K blocks for all the current mounted file system, if you want to display the output of df command in human readable format , use -h option like “df -h”.

How do I check GB on Linux?

The simplest way to find the free disk space on Linux is to use df command. The df command stands for disk-free and quite obviously, it shows you the free and available disk space on Linux systems. With -h option, it shows the disk space in human-readable format (MB and GB).


1 Answers

You can use the -B option.

Man page of df:

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

All together,

df -BG 
like image 170
fedorqui 'SO stop harming' Avatar answered Sep 18 '22 19:09

fedorqui 'SO stop harming'