5

What is the unit for Used and Available? And what does 1K-blocks mean? Does it mean that the size is in kB?

Command:

df -k | head -2

Output:

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda7              9920592   1054440   8354084  12% /

2 Answers 2

3

From man df:

Display values are in units of the first available SIZE from --block-size, and the DF_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE environment variables. Otherwise, units default to 1024 bytes (or 512 if POSIXLY_CORRECT is set).

SIZE may be (or may be an integer optionally followed by) one of following: KB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.

The -k switch is equal to --block-size=1K, which means that the numbers are in multiples of 1024 bytes.

3
  • Two environment variables also affect this, along with find, du, df, ls and others... BLOCKSIZE=1K sets the default as if you used the '-k' or '--block-size=1K' options, while the BLOCK_SIZE (note the underscore) does the same, but has some other options available. I set my BLOCK_SIZE to \'1 (backslash,single-quote,one) which causes find,du,df,ls (and others) to display using COMMAS!!! So much easier to parse!
    – lornix
    Jun 21, 2012 at 8:56
  • So does it mean 9920592 kB, 1054440 kB?
    – AabinGunz
    Jun 21, 2012 at 9:05
  • @AbhishekSimon Yes. You can check by dividing the numbers by 1048576 (1024*1024) and seeing if they match the output of df -h.
    – Indrek
    Jun 21, 2012 at 9:08
3

Yes, you are right, as the doc says:

 -k      Use 1024-byte (1-Kbyte) blocks, rather than the default.  Note
         that this overrides the BLOCKSIZE specification from the environ-
         ment.
3
  • 1
    Question: "What is the unit?" Your answer: "Yes". Huh???
    – sawdust
    Jun 21, 2012 at 19:28
  • To that he guessed.
    – iMom0
    Jun 22, 2012 at 0:49
  • @sawdust I guess the Yes is clearly answering to "Does it mean that the size is in kB?"
    – eckes
    Jul 25, 2017 at 5:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .