One of my friends committed his code in the encoding of GB2312, which broke the build job. I have to find his code and convert.
Deletes capistrano-style release directories (except that there are dashes between the YYYY-MM-DD) Show Sample Output
urldecode files in current directrory
Undo accidental file add to mercurial. This command undo file adds to all recent adds
There's nothing particularly novel about this combination of find, grep, and wc, I'm just putting it here in case I want it again. Show Sample Output
Escapes spaces in paths.
Doesn't use shuf, its much faster with "shuf -n4" instead of sort -R Show Sample Output
calls grep on all non-binary files returned by find on its current working directory Show Sample Output
Assuming you have zenity installed, and assuming that you keep your backgrounds in ~/backgrounds, then this should work for you! :)
You must spezify /where folder and / folder If you have another camera you must experiment with Exif data (after -g and after grep) and mask of your photo files IMG_????.JPG I have do it on Knoppix 6.7.0 You must have installed exiv2. Show Sample Output
Open all files which have some string go directly to the first line where that string is and run command on it.
Other examples:
Run vim only once with multiple files (and just go to string in the first one):
grep -rl string_to_find public_html/css/ | xargs vim +/string_to_find
Run vim for each file, go to string in every one and run command (to delete line):
grep -rl string_to_find public_html/css/ | xargs -I '{}' vim +/string_to_find {} -c ":delete"
xargs is a more elegant approach to executing a command on find results then -exec as -exec is meant as a filtering flag.
If you have a directory with lot of backups (full backups I mean), when it gets to some size, you could want to empty some space. With this command you'll remove half of the files. The command assumes that your backup files starts with YYYYMMDD or that they go some alphabetical order. Show Sample Output
This command removes all ruby gems except the default ones that can not be removed. It is based on http://geekystuff.net/2009/01/14/remove-all-ruby-gems/
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: