Find all files in this directory, including the files in sub-directories, and exclude all files that start with a period (dot files) and any directories named .thumbs
. Then pass the list of results to the wc
command to get a total count:
find . ! -name ".*" ! -path "*.thumbs*" -type f | wc -l
Almost 10 years old, but exactly THE command I was looking for, thanks a ton 😀
Needed to exclude two paths actually, so I replaced the first
-name
with another-path
.Hey Thorben,
I’m glad to hear this was helpful for you! 🙂
Thanks for sharing this! This is exactly what I was looking for. Almost 14 years after it was posted 🙂
You’re welcome, Michal! I’m happy that I could help. 🙂
Thanks, helped me still!