linux count files code example
Example 1: terminal count files in directory
ls | wc -l or ls <path> | wc -l
Example 2: shell show number of files in each folder
du -a | cut -d/ -f2 | sort | uniq -c | sort -nr
ls | wc -l or ls <path> | wc -l
du -a | cut -d/ -f2 | sort | uniq -c | sort -nr