List unique file extensions in a folder

I needed to find the different file extensions inside a folder in Debian Linux. I used the following command to do it.

find . -type f | perl -ne 'print $1 if m/\.([^.\/]+)$/' | sort -u

I found this code in this link.

Leave a Reply

Your email address will not be published. Required fields are marked *