I have a file xyz.log which is of size 1.72MB.

In FLASH file system: If I run du -k xyz.log output is 1761 xyz.log.

I copied the same file to RAM storage and run the du -k xyz.log output is 221 xyz.log.

If I run ls -lrth, the file size in both file systems is same:

-rw-r--r--    1 root     aspa       1.7M Jan  1 00:25 xyz.log

RAM file system is pramfs and FLASH file system is jffs2.

Why the disk usage of same file is different in different file systems and how to get the same disk usage in all file systems?


use du --apparent-size -k

from the manual:


Print apparent sizes, rather than disk usage. The apparent size of a file is the number of bytes reported by wc -c on regular files, or more generally, ls -l --block-size=1 or stat --format=%s. For example, a file containing the word ‘zoo’ with no newline would, of course, have an apparent size of 3. Such a small file may require anywhere from 0 to 16 KiB or more of disk space, depending on the type and configuration of the file system on which the file resides. However, a sparse file created with this command:

          dd bs=1 seek=2GiB if=/dev/null of=big

has an apparent size of 2 GiB, yet on most modern systems, it actually uses almost no disk space.

  • du --help is not showing --apparent-size option in my machine. linux version is Linux – Jagan Aug 14 '13 at 10:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.