1. Check with File Manager

Let’s start with the easiest way. Just open the directory in a file manager and look at the status bar.

If you don’t see a status bar, check “View -> Status bar” in the menu to see if the status bar is enabled.

The disadvantage of this method is that it counts a folder as one item but doesn’t count the number of files in it. Actually, the figure you are getting for how many files are in the directory is the sum of the number of folders and the number of separate files in this directory. If you want to view them separately (e.g. the number of files or the number of directories only), you need to select them, and then the status bar will show the number of the files/directories in the selection only.

 

2. Select the Files/Directories You Want to Count

In addition to showing the number of all files and folders in a directory, File Manager will allow you to do more. For instance, if you want to count only files or only folders, or only a part of the files/folder in a directory, just select them, and the status bar will show the number of files/folders in the selection. For example, if I wanted to see the number of the JPEG files only, I would select them. The result is shown in the status bar.

 

3. Get More Advanced Statistics with the Properties Window

The status bar looks great if you don’t have a lot of files and folders, but if you do, there are better ways to count them.

The File Manager doesn’t show this, but if I select them and right click to open “Properties,” the Properties window tells me how many there are.

 

4. How to Count the Number of Files via the Terminal

If the simple ways of counting files and folders don’t work for you, or if you are a terminal person, the good news is there are numerous ways to get some data about your files and folders via the terminal. For instance, if you simply want a number, use this:

ls -1 | wc -l

his command returns just the number of files/folders. 

 

To count files recursively, use this:

find DIR_NAME -type f | wc -l

 

There are other commands for directory listings such as list commands you can use to get a file number.