count the total number of files in a directory linux code example
Example 1: How to count number of files in each directory
du -a | cut -d/ -f2 | sort | uniq -c | sort -nr
Example 2: count number of files in directory linux
find DIR_NAME -type f | wc -l