On Fri, 25 Jul 2025 19:20:53 +0200,
Dan <[email protected]> wrote:
>
> Here I found a strange behavior of du:
>
> wiz$ ls -lsa index.php
> 16 -rw-r--r-- 1 user www 7412 Oct 19 2024 index.php
> wiz$ du index.php
> 16 index.php <-- this is weird
> wiz$ du -h index.php
> 8.0K index.php
>
> 7.7 stable
>
Let me quote a man page du(1):
-k By default, all sizes are reported in 512-byte block counts. The
-k option causes the numbers to be reported in kilobyte counts.
If you looking a way to have an accurate size of a file in bytes, use wc
--
wbr, Kirill