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

Commandline document conversion with Libreoffice
In this example, the docx gets converted to Open Document .odt format. For other formats, you'll need to specify the correct filter (Hint: see "Comments" link below for a nice list).

Replace spaces in filenames with underscores
I realize there's a few of these out there, but none exactly in this form, which seems the cleanest to me

count IPv4 connections per IP
usefull in case of abuser/DoS attacks.

find packages installed from e.g. sid which are newer than those available from e.g. testing when sid is no longer present as a source repo
This is useful if you add sid, install some packages, then remove sid and want to work out which packages you installed from sid that should be removed (e.g. before an upgrade to the new stable). Alternatively you can think of this as "find installed packages that can no longer be installed."

Open files in a split windowed Vim
-o acts like :spit. Use -O (capital o) for side-by-side like :vsplit. Use vim -d or vimdiff if you need a diff(1) comparison. To split gnu Screen instead of vim, use ^A S for horizontal, ^A | for vertical.

Position the cursor under the current directory line
In case you're like me and like your commands to start on clean lines, especially when you're deep into a 10-level directory tree. This can be added to .bashrc.

Alternative way to generate an XKCD #936 style 4 word password usig sed
This is what I came up to generate XKCD #936 style four-word password. Since first letter of every word is capitalized it looks a bit more readable to my eyes. Also strips single quotes. And yes - regex is a bit of a kludge, but that's the bes i could think of.

gzip compression with progress bar and remaining time displayed

Enter a command but keep it out of the history
Put a space in front of your command on the command line and it will not be logged as part of your command line history.

Deploy git server repo
After, check if working by executing this command locally : git clone git@192.168.0.18:repositories/gitosis-admin.git Tutorial : http://blog.hemca.com/?p=560


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: