Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

df -k option

Status
Not open for further replies.

ashley75

Technical User
Oct 4, 2002
94
0
0
US
what option can I use for verify the disk spaces in Gz instead of Mhz?

thanks,
 
Sorry, didn't realize the -k and -h are redundant. you can do just:

Code:
df -h

and it should give you what you want.

Regards,
Chuck
 
$ df -kh
df: unknown option: h
Usage: df [-F FSType] [-abegklntVv] [-o FSType-specific_options] [directory | block_device | resource]
$ df -h
df: unknown option: h
Usage: df [-F FSType] [-abegklntVv] [-o FSType-specific_options] [directory | block_device | resource]
$
 
sorry, how do you know your OS level?

df -k worked but it's only return bytes which is hard to read.

 
SunOS test 5.8 Generic_117350-33 sun4u sparc SUNW,Sun-Fire-480R
 
Yeah, I am running Solaris 9 and have the "human-readable" option available. Apparently they didn't have that back with Solaris 8.

Hmmmmmm...

The only thing I can think of right now is to maybe run df -k and then use awk to convert the output into what you need.

I am in no way an awk programmer but I will see if I can maybe come up with something. In the meantime, you might want to try posting this possible solution with the following forum: forum271

and see if someone there might be able to come up with an awk solution for this.

Regards,
Chuck
 
df -k doesn't return bytes, it returns Kb, so divide by 1024 for MB, and another 1024 for Gb.
 
Something like this:

Code:
df -k | nawk '
        /^Filesys/ {print;next}
        { printf("%-20s %5.1fGB %5.1fGB %5.1fGB %6s    %s\n",$1,$2/1024/1024,$3/
1024/1024,$4/1024/1024,$5,$6)}
'

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top