Unix File Extension

Unix File Extension

This useful little snippet can be used to find the unique list of extensions for all files in a directory and all its subdirectories. I can never remember the precise awk incantation for this:

% find . -type f | awk -F. '{print $NF}' | tr '[:upper:]' '[:lower:]' | sort -u