commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. 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.
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
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:
dirrrty: use -p to chomp automatically, substitute all newlines away and then replace the "---" by a newline ? bingo!
s/// => s/// is just a cooler way to write s///, s/// which is just the small brother of s///; s/// (comma is an operator!)
have fun!
the output of svn log is annoying to grep, since it spreads the useful info over multiple lines. This compacts the output down to one line so eg you can grep for a comment and see the rev, date & committer straight away.
Updated: MUCH shorter, easier to remember. Now it just replaces newlines with spaces, except on '---' lines.
Helps if you accidentally deleted files from an svn repo with plain rm and you would like to mark them for svn to delete too.
otherwise you get this error message:
svn: Can't move '.svn/tmp/entries' to '.svn/entries': Operation not permitted
Fetch comical VC commit messages from whatthecommit.com
Requires html2text. Print bad, but often funny commit messages from whatthecommit.com
DO NOT RUN this command! THIS WILL CHECK IN ALL CHANGES IN THE CURRENT DIRECTORY TO SUBVERSION WITH A TERRIBLE COMMIT MESSAGE!!!!!!!!!!!!!!! DON'T DO IT! YOU'VE BEEN WARNED!
Fetch comical VC commit messages from whatthecommit.com
The result of this command is a tar with all files that have been modified/added since revision 1792 until HEAD. This command is super useful for incremental releases.
Let's supose some moron used some m$ shit to commit to a later svnsynced repo. On a svn sync all his message logs cause a svnsync: Error setting property 'log': this commands finds all its contributions and fix all his commit logs
This should handle whitespaces well and will not get confused if your filenames have "?" in them
list top committers (and number of their commits) of svn repository.
in this example it counts revisions of current directory.
Standard command, but I always have to search for it... ;-)
When working on a big proeject with SVN, you create quite much files, for now! Can just sit here and type svn add for all of them!
svn status will return a list of all of file which get ?(not add), "M"(Modified), "D"(Deleted)! This code just grep "?" flag, then add it into SVN again!
This command can be used to revert a particular changeset in the local copy.
I find this useful because I frequently import files into the wrong directory. After the import it says "Committed revision 123" or similar. to revert this change in the working copy do:
svn merge -c -123 .
(don't forget the .) and then commit.
No need for grep, let awk do the match. This will not behave properly if the filenames contains whitespace, which is awk's default field separator.