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.
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'.
Using Glob() function to find files recursively We can use the function glob.
Linux recursive directory listing using ls -R command. The -R option passed to the ls command to list subdirectories recursively.
How about this:
find . -type f -name '*.*' | sed 's|.*\.||' | sort -u
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With