Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find all file extensions recursively from a directory?

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.

like image 974
Matthew Avatar asked Feb 14 '11 22:02

Matthew


People also ask

How do I search for all files with specific extensions?

For finding a specific file type, simply use the 'type:' command, followed by the file extension. For example, you can find . docx files by searching 'type: . docx'.

What command can we use to recursively find all files with an INI extension?

Using Glob() function to find files recursively We can use the function glob.

How do I list all files in a directory recursively?

Linux recursive directory listing using ls -R command. The -R option passed to the ls command to list subdirectories recursively.


1 Answers

How about this:

find . -type f -name '*.*' | sed 's|.*\.||' | sort -u 
like image 153
thkala Avatar answered Oct 20 '22 17:10

thkala