2

I'm using command from this topic to view all file extensions in directory and all subdirectories.

find . -type f -name '*.*' | sed 's|.*\.||' | sort -u

How do I can count number of appearance for each extension?

Like:

png: 140

genesst
  • 1,333
  • 1
  • 10
  • 39

1 Answers1

3

Like this, using uniq with the -c, --count flag:

find . -type f -name '*.*' | sed 's|.*\.||' | sort | uniq -c
Robby Cornelissen
  • 91,784
  • 22
  • 134
  • 156