Hide

What's this?

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/

Get involved!

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.

Universal configuration monitoring and system of record for IT.
Hide

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:

Hide

News

May 19, 2015 - A Look At The New Commandlinefu
I've put together a short writeup on what kind of newness you can expect from the next iteration of clfu. Check it out here.
March 2, 2015 - New Management
I'm Jon, I'll be maintaining and improving clfu. Thanks to David for building such a great resource!
Hide

Top Tags

Hide

Functions

Hide

Credits

Commands tagged readline from sorted by
Terminal - Commands tagged readline - 6 results
<ESC> v or ctrl-x ctrl-e
2011-04-30 11:08:02
User: pkufranky
Tags: readline
16

Next time you are using your shell, try typing

ctrl-x ctrl-e # in emacs mode

or

<ESC> v # in vi mode

The shell will take what you've written on the command line thus far and paste it into the editor specified by $EDITOR. Then you can edit at leisure using all the powerful macros and commands of vi, emacs, nano, or whatever.

rlwrap sqlite3 database.db
2010-10-09 15:56:08
User: pykler
Tags: readline
7

Enable readline even if the command line application is not using it.

dd [...] p
2010-07-23 23:19:06
User: bartonski
Functions: dd
1

Use this if you're using vi editing mode.

Example use :

sudo vim /root/bin/ ##uh... autocomplete doesn't work... dd sudo ls /root/bin

##ah! that's the name of the file!

<p> sudo vim /root/bin/ ##resume here! Thanks readline!
<ctrl+u> [...] <ctrl+y>
2010-07-23 03:33:46
User: adeverteuil
156

Example :

vim /etc/fstab

## damn

<ctrl+u> sudo <ctrl+y>

## like a boss.

Example 2 :

sudo vim /root/bin/

##uh... autocomplete doesn't work...

<ctrl+u> sudo ls /root/bin

##ah! that's the name of the file!

<ctrl+y> sudo vim /root/bin/ ##resume here! Thanks readline!
<alt+50>-
2010-01-07 15:32:47
User: kobayashison
-3

In bash, by pressing ALT+n and then a character x, x will be printed n times

I know is not the same as the original command, but is correlated.

set -o vi
2009-03-20 16:29:03
User: Viaken
Functions: set
Tags: readline vi
19

This lets you use your favorite vi edit keys to navigate your term.

To set it permanently, put "set editing-mode vi" in your ~/.inputrc or /etc/inputrc.