1828590 Members
2425 Online
109983 Solutions
New Discussion

ll command

 
John Carver
Frequent Advisor

ll command

When an ll command is issued, the results will
show the size of the directories and files. If a new directory is created, it has a size of 96. It will quickly grow to 1024, then 2048, etc as files are added. What exactly does this size indicator mean? It doesn't seem to indicate an actual size.
3 REPLIES 3
Ted Ellis_2
Honored Contributor

Re: ll command

no it is just adding information to the header for the directory... at least that is what I think is happening. If you want to check the actual usage under a directory... try this:

du -sk *

this will report, one line at a time and in KB, the amount of disk usage for everything immediately under the directory you are sitting.

Wodisch
Honored Contributor

Re: ll command

Hi John,

a directory in a UN*X filesystem is just a table containing only the names of the files and their resp. I-Node number. So, the more files you have in a directory, and the longer their names are, the more space that directory will occupy on disk - but it does NOT matter how big the individual files are!
And since directories cannot shrink, even if you delete files, the directoy itself will only grow over time...
Remember that diskspace is allocated in 1KB chunks, usually (HFS: fragments, VxFS: blocks), hence even the empty directory in its "early" days does occupy 1KB (not 96bytes), though only 96 bytes of that space are actually used.

HTH,
Wodisch
Sean OB_1
Honored Contributor

Re: ll command

The directory simply holds the file and inode information.

It will grow over time as files are added to the directory. Remember that the directory size cannot shrink, but typically it uses so little space that it isn't an issue.