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:
xargs deals badly with special characters (such as space, ' and "). In this case if you have a file called '12" record'.
Parallel https://savannah.nongnu.org/projects/parallel/ does not have this problem.
Both solutions work bad if the number of files is more than the allowed line length of the shell.
With the force options the same results can be achieved
This version makes uses of Bash shell expansion, so it might not work in all other shells.
Find files recursively that were updated in the last hour ignoring SVN files and folders. Incase you do a full svn up on accident.
Searches for all .project files in current folder and below and uses "svn info" to get the last changed revision. The last sed joins every two lines.
Use of hotcopy for safety/stability of the backups.
This command dumps all SVN repositories inside of folder "repMainPath" (not recursively) to the folder "dumpPath", where one dump file will be created for each SVN repository.
This will diff your local version of the file with the latest version in svn. I put this in a shell function like so:
svd() { vimdiff <(svn cat "$1") "$1"; }
Manages everything through one sed script instead of pipes of greps and awks. Quoting of shell variables is generally easier within a sed script.
I'm working in a group project currently and annoyed at the lack of output by my teammates. Wanting hard metrics of how awesome I am and how awesome they aren't, I wrote this command up.
It will print a full repository listing of all files, remove the directories which confuse blame, run svn blame on each individual file, and tally the resulting line counts. It seems quite slow, depending on your repository location, because blame must hit the server for each individual file. You can remove the -R on the first part to print out the tallies for just the current directory.
just change the date following the -r flag, and/or the user name in the user== conditional statement, and substitute yms_web with the name of your module
Lists revisions in a Subversion repository with a timestamp that doesn't follow the revision numbering order. If everything is OK, nothing is displayed.
Really only valuable in a PHP-only project directory. This is using standard linux versions of the tools. On most older BSD variants of sed, use -E instead of -r. Or use: sed 's/\+[[:space:]]\{1,\}//' instead.
exported files will get a .r23 extension (where 23 is the revision number)
The "find" command can be annoying when used inside of a Subversion (or CVS) working directory. Obviously, you can combine this with other predicates and commands to create a more elaborate pipeline:
find /var/svn -type f -not \( -name .svn -prune \) -print0 | xargs -0 md5sum
Note: You can use my "dont-go-there.sh" script to wrap the "find" command and do this automatically at http://forwardlateral.com/blog/2006/02/27/dont-go-there/
Lists the local files that are not present in the remote repository (lines beginning with ?)
and add them.