I need to count the number of files on a large number of directories. Is there an easy way to do this with a shell script (using find, wc, sed, awk or similar)? Just to avoid having to write a proper script in python.
The output would be something like this:
Try the below one:
du -a | cut -d/ -f2 | sort | uniq -c | sort -nr