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.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
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:
make usable on OSX with filenames containing spaces. note: will still break if filenames contain newlines... possible, but who does that?!
Get the list of changed files between revision 43 and HEAD revision: svn diff . -r43:HEAD --summarize
Strip extra 8 characters from every line: cut -c9-99999
Copy the listed files to home/me/destination: cpio -pvdmu ~/destination
Make a plain copy (-p), list files being copied (-v), create needed directories (-d), preserve modification time (-m), overwrite unconditionally (-u)
This command allows you to revert every modified file one-by-one in a while loop, but also after "echo $file;" you can do any sort of processing you might want to add before the revert happens.
command to find out the unused SVN repositories from the server via svnlook. This lists the when the last commit (HEAD revision) has happened in the repository.
handels @, ?, whitespaces in names.
replace "?" and "add" by "!" and "rm" for svn mass remove.
---> I m looking for a nicer way to write it, perhaps with something using " perl -ne '`blahblah` if /\?(.*)/' "
If you have ever edited a locally checked out version of a file to tweak it for testing purposes, and came back to it over a weekend, you might have forgotten what you exactly changed. This command helps you see the differences between the the checked in SVN version, and the one you tweaked.
simply change extension for others programming languages
List all svn externals dependencies of a specific project.
Number of files in a SVN Repository
This command will output the total number of files in a SVN Repository.
svn log -v --> takes log of all
Filter1
--------
-r {from}{to} --> gives from and to revision
Filter2
--------
awk of line 'r'with numbers
Assign user=3rd column [ie; username]
Filter3
--------
if username = George
print details
Filter4
--------
Print lines starts with M/U/G/C/A/D
[* A Added * D Deleted * U Updated * G Merged * C Conflicted]
Filter5
--------
sort all files
Filter6
-------
Print only uniq file's name alone.
afaik, svn doesn't have a good, scriptable way of telling you these two basic pieces of information.
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