What command, or collection of commands, can I use to return all file extensions in a directory (including sub-directories)?
Right now, I'm using different combinations of ls
and grep
, but I can't find any scalable solution.
What command, or collection of commands, can I use to return all file extensions in a directory (including sub-directories)?
Right now, I'm using different combinations of ls
and grep
, but I can't find any scalable solution.
list all extensions and their counts of current and all sub-directories
Yet another solution using find (that should even sort file extensions with embedded newlines correctly):
if you are using Bash 4+
Ruby(1.9+)
I was just quickly trying this as I was searching Google for a good answer. I am more Regex inclined than Bash, but this also works for subdirectories. I don't think includes files without extensions either:
ls -R | egrep '(\.\w+)$' -o | sort | uniq -c | sort -r
Boooom another:
How about this: