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:
... plus do a sort according frequency
There are 3 alternatives - vote for the best!
Works on current directory, with built-in sorting.
Get the longest match of file extension (Ex. For 'foo.tar.gz', you get '.tar.gz' instead of '.gz')
Just a little simplification.
If your grep doesn't have an -o option, you can use sed instead.
A shorter version
If you can do better, submit your command here.
You must be signed in to comment.