commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
All with only one pipe. Should be much faster as well (sort is slow). Use find instead of ls for recursion or reliability.
Edit: case insensitive
If your grep doesn't have an -o option, you can use sed instead.
Just a little simplification.
with grep for em:name rather than name, you will get much better result.
1.) my profile ends with $USER not with .default
2.) only grep for the first occurrence because some extensions have the translated name also inside the install.rdf
I created this command to give me a quick overview of how many file types a directory, and all its subdirectories, contains. It works based off file extension, rather than file(1)'s magic output, because it ended up being more accurate and less confusing.
Files that don't have an ext (README) are generally not important for me to want to count, but you're free to customize this fit your needs.