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.
Also works on mac.
Update: You are correct Matthew. Based on your comment, here is an updated version:
ls -R1 | egrep -C 0 "[^\.]+\.[^\./:]+$" | sed 's/.*\.//' | sort -u