1
1
For example, it shows the kernel as being 18M but the Applications folder as being 3.8K
BSD/Darwin
1
1
For example, it shows the kernel as being 18M but the Applications folder as being 3.8K
BSD/Darwin
3
According to the man page for ls:
List information about the FILEs (the current directory by default).
ls
is intended to show the size of the files on the file system, not to show the usage of a directory. du
will show total usage of a file system object.
So ls
is doing what it is supposed to do. While your Applications directory may contain files that use more than 3.8K, the Applications directory itself is really only 3.8K on the disk.
1
Because you're not on Windows, where the world pretends that directories have no space cost, and all directories are zero length. (Some parts of the Windows world pretend that the size of a directory is the cumulative size of all of the things contained in the directory.)
On Unices and Linux, the ls -l
command, when displaying a directory entry that points to another directory, shows the size of the directory. It shows the amount of space devoted to actually storing the entries in the directory itself. For each directory entry, ls -l
always shows the size of the node pointed to by that entry, be it file, symbolic link, or directory.