wdprice3 BinaryBuffonary 45912 Posts user info edit post |
how can I list all the unique file extensions in a directory tree? i've googled and found some command prompt codes, but none work (keeps saying 'sed' is not recognized... and this is in every batch of code I've found).
find . -type f | sed -e 's/.*\.//' | sort | uniq -c | sort -rn
not that I know what that means...
XP]9/3/2010 2:29:09 PM |
El Nachó special helper 16370 Posts user info edit post |
Whatever you do, don't tell us what operating system you're using.
Let's let that be a surprise. 9/3/2010 2:33:18 PM |
scud All American 10804 Posts user info edit post |
http://cygwin.org/ 9/3/2010 6:00:20 PM |
lewisje All American 9196 Posts user info edit post |
better idea: http://gnuwin32.sourceforge.net/packages.html or for a more automated experience: http://sourceforge.net/projects/getgnuwin32/files/
Install "sed," "coreutils," "findutils," and "fileutils" along with anything else you want into C:\gnuwin32\ Then press WinKey+Break to open System Properties, go to the Advanced tab, and click "Environment Variables" Then under System Variables, find PATH and edit it by typing this right at the beginning: C:\gnuwin32\bin; (yes the semicolon does need to be there)
After pressing OK a couple times and probably logging out and back in to Windows, you should be able to use code samples like that all day long; I personally enjoy being able to use "more" and "ls" without needing to open a Cygwin shell.9/3/2010 8:22:36 PM |
scud All American 10804 Posts user info edit post |
you prefer cmd.exe to bash or zsh? To each their own I suppose... 9/4/2010 6:30:46 PM |
lewisje All American 9196 Posts user info edit post |
when in rome windows...
I actually love this in combination with the "Open Command Window Here" command in the right-click menu for folders; the way to get this is different for every version of Windows 9/4/2010 6:43:11 PM |
wdprice3 BinaryBuffonary 45912 Posts user info edit post |
^^^Thanks, I'll look at that/try to figure it out ^^doesn't matter to me. I don't know shit about doing this and I just need it done one time to figure out if there are some different files types within a directory tree of about 50,000 files and hundreds of folders (it's my music and for some reason, not all my songs are loading into my media player, tag editor, and music uploading service, thus I'm hoping there are just a few hundred files that aren't mp3s).
[Edited on September 5, 2010 at 2:09 PM. Reason : .] 9/5/2010 2:08:30 PM |
Stein All American 19842 Posts user info edit post |
http://www.computerperformance.co.uk/powershell/powershell_recurse.htm
You'll have to download Powershell if you're running XP or Vista, but otherwise this page will teach you everything you need to know. 9/5/2010 6:30:24 PM |
lewisje All American 9196 Posts user info edit post |
yeah, PowerShell is also good, but the Unix way is better-supported on the Internets 9/5/2010 11:39:08 PM |
Stein All American 19842 Posts user info edit post |
Yeah, and it only requires a ton of unnecessary software being installed along with editing environment path variables! A better solution indeed! 9/6/2010 4:17:52 PM |
qntmfred retired 40726 Posts user info edit post |
^ 17.999k 9/6/2010 4:18:33 PM |