Use the following command to print a sorted list of the number of different types of files within the current directory.
find . -type f | perl -ne 'print $1 if m/\.([^.\/]+)$/' | sort | uniq -c | sort -n
See a breakdown of what this command does on explainshell.com.
Alternatively, this command will do the same.
find . -name '*.?*' -type f | rev | cut -d. -f1 | rev | tr '[:upper:]' '[:lower:]' | sort | uniq --count | sort -rn
See a breakdown of what this command does on explainshell.com.
Add new comment