ravbholua@ravbholua-Aspire-5315:~/CCPP/HelloWorld/das/das1$ ls ./control
amer  calls  q1  q2  q3  quit.c  RCS  SCCS
ravbholua@ravbholua-Aspire-5315:~/CCPP/HelloWorld/das/das1$ du ./control
20  ./control/calls
16  ./control/RCS
40  ./control/SCCS
96  ./control
ravbholua@ravbholua-Aspire-5315:~/CCPP/HelloWorld/das/das1$ du ./control/*
0   ./control/amer
20  ./control/calls
4   ./control/q1
4   ./control/q2
4   ./control/q3
4   ./control/quit.c
16  ./control/RCS
40  ./control/SCCS

Please note du reports that control directory occupies 96 bytes. Now when I add the bytes consumed by the individual files, it comes to be 92 bytes.

In the same way, for all reporting du shows 4 bytes more than the sum total of the contents.

What this extra 4 bytes from?


ravbholua@ravbholua-Aspire-5315:~/CCPP/HelloWorld/das/das1$ ls -ld $_
drwxrwxr-x 5 ravbholua ravbholua 4096 Dec  8 21:39 control

du ( or linux) uses 1024-byte blocks (1KB) for reporting (1024 * 4 = 4096) a file.

ravbholua@ravbholua-Aspire-5315:~/CCPP/HelloWorld/das/das1/control$ ls
ame  amer  calls  q1  q2  q3  quit.c  RCS  SCCS
ravbholua@ravbholua-Aspire-5315:~/CCPP/HelloWorld/das/das1/control$ du ame
4   ame
ravbholua@ravbholua-Aspire-5315:~/CCPP/HelloWorld/das/das1/control$ cat ame
ravbholua@ravbholua-Aspire-5315:~/CCPP/HelloWorld/das/das1/control$ ll ame
-rw-rw-r-- 1 ravbholua ravbholua 2 Dec  8 21:39 ame

So the above file 'ame' which contains only letter 'a' and 'enter key' occupies 4 KBs of my disk space.

So that means for a file/directory linux is allocating 4KB of my disk space!!!! and it will allocate in multiples of 4KB.

Also adding one more thing: ls -l reports size in units of byte for a directory but not for a regular file. With ref. to the above file 'ame', its clear that for a regular file ls -l reports size as character count and not bytes.

  • 2
    Note that sizes are not in bytes. As you can read in du info page: Normally the disk space is printed in units of 1024 bytes, but this can be overridden
    – andcoz
    Commented Dec 8, 2013 at 16:13
  • @andcoz, the space is generally printed in 512 byte units. Only some implementations like GNU or busybox use kilo-bytes (actually kibibytes) unless in POSIX/Unix compatibility mode, such as when the POSIXLY_CORRECT environment variable is set). Commented Dec 8, 2013 at 16:33
  • This is normal. Disks are handled a large number of sectors, not as an even larger number of bytes. Commented Dec 9, 2013 at 8:31

2 Answers 2


The control directory itself has size 4 and it is included in your first command. The second variant doesn't calculate the directory size because you're not passing it to du, but only its contents.

There is also the possibility that you have hidden files (dot-files) that are excluded when expanding the * glob so that du doesn't bother with them.


First, the number isn't in bytes. The unit is either kilobytes or half-kilobytes, depending on your implementation.

When you run du ./control/*, you get information for the files contained in the directory control, but not for the directory control itself. Directories have a size too — the information about the files they contain has to be stored somewhere. The size of control itself is 4 units.

  • I have edited my Q. Please give your confirmation on what I stated.
    – Ravi
    Commented Dec 9, 2013 at 3:37
  • @Ravi The output of ls -l shows that your du implementation uses units of 1kB. Commented Dec 9, 2013 at 10:21

You must log in to answer this question.

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