count number of files in a different directory python code example
Example 1: python count files directory
import os
len(os.listdir(directory))
Example 2: How to count number of files in each directory
du -a | cut -d/ -f2 | sort | uniq -c | sort -nr