understanding between blocks and kilo bytes

I admit I'm a bit slow for this kind of basic convertion. During my young age, I always wonder about blocks and bytes and how to convert between them and recently it became clear after some try and error calculation on df output. This is important because some program require user to input size in blocks such as ulimit.

In ulimit manpage, I read an option which is
-c The number of 512-byte blocks on the size of core dumps.

So I can assume that 1 block equals to 512 bytes (to reader, please assist, thanks). If I look at one line of my df output:

/export/home (/dev/dsk/c0t0d0s7 ):53645828 blocks 3232280 files

Then I know that my home directory took 53645828 * 512 / 1024 of Kilobytes. To be sure it is correct, use df -b:

/dev/dsk/c0t0d0s7 26822914

That means 53645828 blocks equals to 26822914 bytes.

No comments:

Post a Comment