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.
To display information of all file system statistics in GB (Gigabyte) use the option as 'df -h'.
Use the df command to show the amount of free disk space on each mounted disk.
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”.
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).
You can use the -B
option.
Man page of df:
-B, --block-size=SIZE use SIZE-byte blocks
All together,
df -BG
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With