count number of files in a folder 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 a number of file in a folder python
import os
len([item for item in os.listdir(folderPath)])