Why does OS X Finder recognize a folder as a file when it counts the number of files?

When I select a folder in Finder and click cmd+i(or cmd+option+i), it shows the number of files in the folder. However, that number is weird for me, because they count a folder itself as a file. For example, when I have a single file in my Download folder and I clicked cmd+i on Download folder, then the number of files in a inspection window is 2, not 1. It is because that number includes not only the file inside the folder, but also the folder itself. (Check the below image)


User uploaded file


This is not a big problem if there is no hierarchical structure in my folder. But, if I have thousands of files and folders inside, it is really hard to figure out how many files(not folders) are inside. I cannot understand why Mac OS X counts a folder as a file. In fact, a folder is not an actual file, just a container.

So, is there any philosophy to do like this? Or is there any way to count only the number of actual files?

Mac mini (Late 2012), OS X Mavericks (10.9.5)

Posted on Sep 27, 2014 7:20 AM

Reply
5 replies

Sep 27, 2014 8:15 AM in response to byron1st

It will count hidden items along with the contents of subfolders.

It doesn't include .DS_store, though.

And, I've found some random behavior throughout different folders. It is showing my home folder with 0 items, for instance.

But, that resolved itself after a while. It may need time to update the counts, but it doesn't indicate that while it is doing it.

Sep 27, 2014 9:00 AM in response to byron1st

Sorry byron1st


there is no way to count only files in a folder.

Finder will count everything inside, folders and files.

Information about a folder will count the same.


If there are no subsubfolders in one folder, maybe a little trick can help:

Select list view for the open folder, close all subfolders.

Type command+# to see the footer of the window, that counts (hopefully) only the closed subfolders (content) in the open folder.

Remember the amount.

Hold option and click on one triangle in front of one subfolder. All subfolders will be opened!

The difference between amount a and amount b is the number of files (and subsubfolders, if unfortunately inside…).

Sep 27, 2014 9:50 AM in response to trollius

trollius wrote:


Sorry byron1st


there is no way to count only files in a folder.

Finder will count everything inside, folders and files.

Information about a folder will count the same.

I think you're missing the point (or I am). As per his example, he has one file in the folder, but two items. Byron assumes it is counting the enclosing folder. I think it is counting hidden items, also (besides .DS_store).


But you are correct. The "items" include any subfolders with the folder being examined.

Sep 27, 2014 11:32 PM in response to Barney-15E

Barney-15E wrote:

I think it is counting hidden items, also (besides .DS_store).

In fact, that number is not including hidden files, because if it counts hidden files, the number should be five. (In my Download folder, there are three more hidden files in addition to .DS_store) So, I guess, Finder counts the number including the enclosing folder as a file. I don't know why Finder do this.

Sep 28, 2014 2:31 AM in response to byron1st

byron1st wrote:


Barney-15E wrote:

I think it is counting hidden items, also (besides .DS_store).

In fact, that number is not including hidden files, because if it counts hidden files, the number should be five. (In my Download folder, there are three more hidden files in addition to .DS_store) So, I guess, Finder counts the number including the enclosing folder as a file. I don't know why Finder do this.

It doesn't. The item count is just messed up.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Why does OS X Finder recognize a folder as a file when it counts the number of files?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.