Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need a program which will recursively scan a directory and tell me all of the distinct filetypes that are inside the folder

share|improve this question
Windows, MacOS or Linux? GUI or CLI? – Bobby Jan 14 '10 at 16:15
up vote 1 down vote accepted

You can set WinDirStat to look at a specific folder and it will sum up the file-types

And you can even create a report, which you could parse if you need it for something specific

alt text

share|improve this answer

You don't mention what OS you use but in BSD, Linux or other POSIX systems i'd use the file(1) command.

A simple file dir/* will do the trick.

Oh and to recursively scan a directory you can do this find dir -type f -exec file {} \;.

share|improve this answer

If you're using Windows Vista or 7 and you don't want to install a third party software solution, this can also be accomplished using PowerShell:

Get-ChildItem C:\Windows\System32 | Select-Object Extension | Sort-Object -CaseSensitive Extension | Get-Unique -AsString
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.