All commands (14,187)

What's this?

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.

Share Your Commands


Check These Out

Create a git alias that will pull and fast-forward the current branch if there are no conflicts
This command will first add an alias known only to git, which will allow you to pull a remote and first-forward the current branch. However, if the remote/branch and your branch have diverged, it will stop before actually trying to merge the two, so you can back out the changes. http://www.kernel.org/pub/software/scm/git/docs/git-pull.html Tested on git 1.5.6.1, msysgit (Windows port) Actually this is not really the way I want it. I want it to attempt a fast-foward, but not attempt to merge or change my working copy. Unfortunately git pull doesn't have that functionality (yet?).

list all file-types (case-insensitive extensions) including subdirectories

Export unpushed files list

Run a program transparently, but print a stack trace if it fails
For automated unit tests I wanted my program to run normally, but if it crashed, to add a stack trace to the output log. I came up with this command so I wouldn't have to mess around with core files. The one downside is that it does smoosh your program's stderr and stdout together.

Filter the output of a file continously using tail and grep
The OPs solution will work, however on some systems (bsd), grep will not filter the data, unless the --line-buffered option is enabled.

Hypnosis
for OS X

Capture video of a linux desktop
This will grab the image from desktop, starting with the upper-left corner at x=100, y=200 with a width and height of 1024?768.

Delete the specified line

Create subversion undo point
Allows you to save progress without committing. To revert to an undo point, svn revert then apply the undo point with patch. $ svn revert -R . && patch -p0 < .undo/2009-03-27_08:08:11rev57 Similar: http://www.commandlinefu.com/commands/view/373/archive-all-files-containing-local-changes-svn

Simple Gumblar check command


Stay in the loop…

Follow the Tweets.

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

Subscribe to the feeds.

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: