4
$ ls -lsh file.qcow2
204K -rw-r--r-- 1 root root 193K Jul 19 15:18 file.qcow2`

$ ls -sh file.qcow2                                                                                           204K file.qcow2`

What is the significance of 193K in the output of ls -lsh <file>?

muru
  • 197,895
  • 55
  • 485
  • 740

1 Answers1

8

Read the man pages when in doubt.

man ls

shows the following:

   -l     use a long listing format
   -s, --size
          print the allocated size of each file, in blocks
   -h, --human-readable
          with -l and/or -s, print human readable sizes (e.g., 1K 234M 2G)

Without the -l you do not see all the permissions, owner, size and date information of the file.

The -s means to print the allocated size of the file. The 193K you are seeing is the actual size. The 204K is the allocated size as the drive is divided up into 4K clusters. 204K / 4 = 51 as that means the file takes 51 clusters.

Terrance
  • 41,612
  • 7
  • 124
  • 183
  • 2
    Interesting to observe that the allocated size isn't 196K (=49*4) because a 193K file would fit into 49 blocks 4K each. – But that would be another question... – PerlDuck Jul 20 '18 at 17:40