shell show number of files in each folder

C++
ls | wc -ldu -a | cut -d/ -f2 | sort | uniq -c | sort -nr

Source

Also in C++: