file extensions in a directory structure

Hi,

I have a huge directory structure with multiple directories and subdirectories in each of the directory.

i am trying to find the various file extensions in the directory structure and put them into a file.

is there any way through which i can accomplish this

try..

find . -type f | awk -F. '{print $NF}' > file

Another solution (supports files without extensions) :

find . -type f | awk -F/ '{n=split($NF,f,"."); print (n > 1 ? f[n] : "") }' | sort -u > file

Jean-Pierre.

Solution using array:
Take extension list from current directory and subdirectories. Look your ls -1R output, if this need fixing (special lines like directory). This use assosiative array of ksh.

#!/bin/ksh
#listext
typeset -A exts
ls -1R | while read line
do
     case "$line" in
           "") continue ;; # empty line
           *:)  continue ;; # dir
     esac
     ext=${line##*.}
     [ "$ext" = "$line" ] && continue # no ext
     # or if you like to count also files without ext, then ex. mark those -
     # "$ext" = "$line" ] && ext="-"
     exts["$ext"]=1
done

for ext in ${!exts[*]}
do
     echo "$ext"
done 
chmod a+rx listext
./listext > result.txt

THanks a lot ryandegreat25....

it works...

is there any way i can get the unique extensions from that