Reputation: 57
The question is itself self-explanatory.
I tried the following command I found somewhere on the internet but it shows the number just in the immediate directory and not its subdirectories.
ls -lR ./*.jpg | wc -l
I am searching for all the files with the extension ".jpg" in the current folder and its subdirectories.
Upvotes: 0
Views: 55
Reputation: 1288
find . -type f -name '*.jpg' | wc -l
Find all the files (type f) that have a name that matches '*.jpg' then count them with wc
Upvotes: 1