Requesting terminal command that (recursively) totals size per file extension and number of files per extension
by triciasurfer from LinuxQuestions.org on (#56KEP)
I have a folder containing many subfolders of stuff. Let's say it's /home/tricia/miscellany/
Is there a command I can run which will breakdown the contents by file extension in 2 ways:
A) number of files per file extension and
B) total size per file extension.
Let's say I don't want to manually type each file extension in the terminal.
I'd like an output that looks like this:
*.txt 23 files, 10.2MB
*.pdf 8 files, 23.2MB
*.db 3 files, 2.3MB
*.cb 24 files, 2.3GB
*.html 2,508 files, 43.2MB
*.readme 13 files, 4KB


Is there a command I can run which will breakdown the contents by file extension in 2 ways:
A) number of files per file extension and
B) total size per file extension.
Let's say I don't want to manually type each file extension in the terminal.
I'd like an output that looks like this:
*.txt 23 files, 10.2MB
*.pdf 8 files, 23.2MB
*.db 3 files, 2.3MB
*.cb 24 files, 2.3GB
*.html 2,508 files, 43.2MB
*.readme 13 files, 4KB