Recursively Count Files in Directories With Linux
Quick file count with ls | wc -l. Use find if you need to go deep or filter by type. Good for sanity-checking file dumps.
ls | wc -l
If you want a little more control over what you’re counting, you can use:
find DIR_NAME -type f | wc -l