8 rollback of previous edits, I want to keep the example simple, no bikeshedding
source | link

You could use find and uniq for this, e.g.:

$ find . -type f | sed 's/.*\.//' | sort | uniq -c | sort
    3 mp4
   16 avi
   29 jpg
  136 mp3
    3 mp4

Command explanation

  • find recursively prints all filenames
  • sed deletes from every filename the prefix until the file extension
  • uniq assumes sorted input
    • -c does the counting (like a histogram).
  • sort is used twice, first sorting inputs (file extensions), then outputs (counts)

You could use find and uniq for this, e.g.:

$ find . -type f | sed 's/.*\.//' | sort | uniq -c | sort
    3 mp4
   16 avi
   29 jpg
  136 mp3

Command explanation

  • find recursively prints all filenames
  • sed deletes from every filename the prefix until the file extension
  • uniq assumes sorted input
    • -c does the counting (like a histogram).
  • sort is used twice, first sorting inputs (file extensions), then outputs (counts)

You could use find and uniq for this, e.g.:

$ find . -type f | sed 's/.*\.//' | sort | uniq -c
   16 avi
   29 jpg
  136 mp3
    3 mp4

Command explanation

  • find recursively prints all filenames
  • sed deletes from every filename the prefix until the file extension
  • uniq assumes sorted input
    • -c does the counting (like a histogram).
7 Rollback to Revision 5 - Edit approval overridden by post owner or moderator
source | link

You could use find and uniq for this, e.g.:

$ find . -type f | sed 's/.*\.//' | sort | uniq -c | sort -n
    3 mp4
   16 avi
   29 jpg
  136 mp3

Command explanation

  • find recursively prints all filenames
  • sed deletes from every filename the prefix until the file extension
  • uniq assumes sorted input
    • -c does the counting (like a histogram).
  • sort is used twice, first sorting inputs (file extensions), then sorting outputs (counts) numerically

You could use find and uniq for this, e.g.:

$ find . -type f | sed 's/.*\.//' | sort | uniq -c | sort -n
    3 mp4
   16 avi
   29 jpg
  136 mp3

Command explanation

  • find recursively prints all filenames
  • sed deletes from every filename the prefix until the file extension
  • uniq assumes sorted input
    • -c does the counting (like a histogram).
  • sort is used twice, first sorting inputs (file extensions), then sorting outputs (counts) numerically

You could use find and uniq for this, e.g.:

$ find . -type f | sed 's/.*\.//' | sort | uniq -c | sort
    3 mp4
   16 avi
   29 jpg
  136 mp3

Command explanation

  • find recursively prints all filenames
  • sed deletes from every filename the prefix until the file extension
  • uniq assumes sorted input
    • -c does the counting (like a histogram).
  • sort is used twice, first sorting inputs (file extensions), then outputs (counts)
6 fix sorting to be numerical
source | link

You could use find and uniq for this, e.g.:

$ find . -type f | sed 's/.*\.//' | sort | uniq -c | sort -n
    3 mp4
   16 avi
   29 jpg
  136 mp3

Command explanation

  • find recursively prints all filenames
  • sed deletes from every filename the prefix until the file extension
  • uniq assumes sorted input
    • -c does the counting (like a histogram).
  • sort is used twice, first sorting inputs (file extensions), then sorting outputs (counts) numerically

You could use find and uniq for this, e.g.:

$ find . -type f | sed 's/.*\.//' | sort | uniq -c | sort
    3 mp4
   16 avi
   29 jpg
  136 mp3

Command explanation

  • find recursively prints all filenames
  • sed deletes from every filename the prefix until the file extension
  • uniq assumes sorted input
    • -c does the counting (like a histogram).
  • sort is used twice, first sorting inputs (file extensions), then outputs (counts)

You could use find and uniq for this, e.g.:

$ find . -type f | sed 's/.*\.//' | sort | uniq -c | sort -n
    3 mp4
   16 avi
   29 jpg
  136 mp3

Command explanation

  • find recursively prints all filenames
  • sed deletes from every filename the prefix until the file extension
  • uniq assumes sorted input
    • -c does the counting (like a histogram).
  • sort is used twice, first sorting inputs (file extensions), then sorting outputs (counts) numerically
5 Add a final sort to list the counts in increasing order
source | link
4 improved formatting
source | link
3 modify to also work on Mac OS X, but leave the sort order alone
source | link
2 modify to also work on Mac OS X, and to sort result by quantity descending
source | link
1
source | link