What is the equivalent of “df -g” in linux?

I would like to convert "df -g" from solaris to linux. Would like to know what is the linux equivalent of "df -g"

On solaris man df will give option -g as such:

Print the entire statvfs(2) structure. This option is used only for mounted file systems. It cannot be used with the -o option. This option will override the -b, -e, -k, -n, -P, and -t options.

I am currently unable to find -g for linux and would like to know if -g is now obsolete.

2 Answers

This is not a standard (or widely adopted) option, and not present in any other df implementation except Solaris. (For example, OpenBSD's df uses -g for a completely different purpose.)

For Linux, you can get a text version of the statvfs() results using stat -f on each mountpoint individually.

$ stat -f / /boot File: "/" ID: 9a1f066700795d36 Namelen: 255 Type: zfs
Block size: 131072 Fundamental block size: 131072
Blocks: Total: 13928460 Free: 13756444 Available: 13756444
Inodes: Total: 3521952399 Free: 3521649824 File: "/boot" ID: 38db9d923fe678d5 Namelen: 255 Type: ext2/ext3
Block size: 1024 Fundamental block size: 1024
Blocks: Total: 247591 Free: 128457 Available: 124361
Inodes: Total: 65024 Free: 64652
$ stat -f -c %n:%i,%s / /boot
/:9a1f066700795d36,131072
/boot:38db9d923fe678d5,1024
2

As an alternative in Linux systems, df can be used with the combination of "h" to be human readable and "P" to fix the alignment.

df -hP

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like