2

My Downloads folder looks utterly empty, not a single file or folder. And I have already emptied the Trash too. But for some reason, a Terminal ls run for this folder says there are 16 items! Here's the exact results on the Terminal:

Amits-MacBook:~ Amit$ ls -axhl ~/Downloads
total 16
drwx------+  4 Amit  staff   136B May 16 19:26 .
drwxr-xr-x+ 21 Amit  staff   714B May 16 19:25 ..
-rw-r--r--@  1 Amit  staff   6.0K May 16 19:26 .DS_Store
-rw-------   1 Amit  staff     0B May  6 15:18 .localized
Amits-MacBook:~ Amit$

And the Get Info window shows 1 item:

enter image description here

Please advise what's going on here and how I can get my Downloads folder to stop imagining things?

4

The ls manual page explains this:

total 16

Total, here, does not represent the number of items, but the sum of the number of BLOCKS allocated to the files in the directory.

For example, if the block size is 512 bytes (don't quote me on this, but the math checks out), and the total disk space used by the directory is 8KB on disk:

8 KB = 8000 bytes 
8000 B/512 B = 15.625 
Rounding this value up equates to 16 blocks. 

My empty Downloads directory reads the same:

njboot$ ls -axhl ~/downloads
total 16
drwx------   4 njboot  staff   136B May 16 20:17 .
drwxr-xr-x  20 njboot  staff   680B May  9 10:02 ..
-rw-r--r--@  1 njboot  staff   6.0K May 16 20:17 .DS_Store
-rw-------   1 njboot  staff     0B Dec  8 14:27 .localized

Download folder

  • That's quite some relief and thank you for that! However, I am still confused about why it should occupy ANY space at all. and why doesn't the "Get Info" window say zero items when the folder is actually empty? On the other hand, my Movies folder is also empty and its "Get Info" window still says 1 item but occupying zero bytes. Why should Downloads folder occupy 8 bytes while an equally empty Movies folder occupy none? And why 1 item in each? – TheLearner May 16 '14 at 23:56
  • The folder isn't empty. It contains files hidden from finder (those prepended with "."). The "-a" shows the hidden files. Also, keep in mind it's allocating a certain amount of space to the directory, regardless of whether the space is being taken up. That's the nature of a journaled file system. – njboot May 17 '14 at 0:06
  • Agreed that the space is being assigned and not used. But what does that item count in "Get Info" correspond to then? It couldn't be the count of hidden folders because there are two of them, right? Also, shouldn't the same apply to the Movies folder? The space allocation, that is. How come it has zero bytes allocated? – TheLearner May 17 '14 at 0:10
  • Run the same command on the ~/Movies folder. Does it contain a .DS_Store file and .localized file? – njboot May 17 '14 at 0:41
  • 1
    Get Info shows 1 item because the folder itself counts as an item. If it contained (for example) 4 empty subfolders, Get Info would show 5 items, because the parent and all 4 subfolders count. – Gordon Davisson May 18 '14 at 5:58

You must log in to answer this question.

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