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

Status
Not open for further replies.

icu812

MIS
Sep 10, 2001
52
0
0
US
Can someone please tell me if there is a way to know,at a glance whether the output of a df -k is kilobytes, megabytes or gigabytes?????????? (I am always having to do the math). Thanks
 
df -k is always in 1024 blocks: that is KB -- always. plain old df is in 512 block sizes (1/2 KB).

You could probably work out some kind of alias that would do the math for you, but for the most part a ballpark figure is sufficient. So, if you do a df -k and get a return for a filesystem of 2555904, I would count that as 2.5 GB, even though is is actually 2.4375. 2.5 is close enough. And I'd count a readout of 294912 as about 293 MB, even though it really is just 288.

 
try using df -sk as it gives its output in kilobytes if a k switch is supported
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top