Just perform this command under the directory:
find . -type f | wc -l
and you will get the total number of files under it. Simply copy and paste that to do the trick.
This should also work on all *nix OS.
Related Posts
- Linux: How to find all the files containing a particular text string?
- PHP: Copy, Rename or Move a File
- What is this Linux command?
- Safely and Quickly Transfer Files between Your Hosts / Hosting Accounts / Servers with scp command on SSH tunnel
- Linux: Check how much disk storage each directory takes up (Disk Usage command – du)

{ 10 comments… read them below or add one }
I will try this command later when I switched to Linux. I am still in exploration stage in Ubuntu and I am having difficulty every now and then that is why I tend to go back to Windows when I am rushing up something.
Hi! Are you interested in getting a banner/ header/ logo/ template/ business cards/ mascot designs / directory or article submissions, for your site for no money, in return we require text links from your site http://www.kavoir.com. Approaching you through this form since I could not find out the email address. Please get back to me if you are interested.
@Hans
While many agree that learning new things is exciting, refreshing and often bringing new perspectives, it’s in nature a cost.
Every new approach comes with a cost, to adopt it or not is the question of cost-effectiveness.
I am going to switch to linux in a few days, most likely sometime before Christmas! I will surely have to save this code somewhere. This will make life much easier. Thanks for the quick tip!
Thank You,
Nice tip. Could you use something like this:
ls | wc -l
as well?
Unfortunately this wont work on directories with a lot of files in them; you’ll get the “Argument list too long” error…
@Chris
I used it under a directory with around 18,000 gif images and it didn’t show up the error. What’s the rough number of files you have?
ls -l . | egrep -c ‘^-’
Thank you for this tip. At some point I also needed to count files in all subdirectories as well, so I found this solution, may be it will be useful for somebody else:
ls -laR | wc -l
Nice catch!