Small Mosaic


Categories:

/books
/career
/codinghorrors
/events
/geekstuff
/justdont
/languages
/languages/bash
/linkshot
/magazines
/meta
/misctech
/movies
/nottech
/operatingsystems
/operatingsystems/linux
/operatingsystems/linux/debian
/operatingsystems/solaris
/perl
/presentations
/programming
/python
/ruby
/security
/security/apache
/security/tools
/serversmells
/services
/services/dns
/sites
/specifications
/sysadmin
/testing
/tools
/tools/commandline
/tools/firefox
/tools/gui
/tools/network
/tools/online
/tools/online/greasemonkey
/tools/puppet
/unixdaemon

Archives:

July 20111
June 20112
May 20113
April 20112
March 20117
January 20111
December 20103
November 20103
August 20101
July 20101
June 20104
May 20102
April 20101
March 20108
February 20101
January 20102
Full Archives

Fri, 25 Mar 2005

Externally Edit Your Command Line
Most people know you can change the readline settings to either vi or emacs style key-bindings, but far less people know you can actually open the current, or a previous, command line in your editor of choice using 'fc'.

If you type 'fc' on the command line then the previous command will be open in the defined editor; if you want to select a further back command you can use 'fc pattern'. When editing is complete the edited commands are echoed and executed.

The actual editor to be opened can be defined in a number of ways, you can pass the '-e' option to 'fc' to set the editor; but you don't want to do this. If no '-e' is given, the value of the FCEDIT variable is used, and the value of EDITOR if FCEDIT is not set. If neither variable is set, vi is used (which is fine by me :)).

This isn't functionality you'll use on a daily basis, occasionally however it makes some very awkward command line tweaks a lot easier. For full details see "man bash", the "SHELL BUILTIN COMMANDS" section.

Like this post? - Digg Me! | Add to del.icio.us! | reddit this!

Posted: 2005/03/25 11:03 | /tools/commandline | Permanent link to this entry | This entry and same date


books career codinghorrors events geekstuff justdont magazines meta misctech movies nottech operatingsystems/linux operatingsystems/linux/debian operatingsystems/solaris perl programming python ruby security security/apache security/tools serversmells services/dns sites sysadmin testing tools tools/commandline tools/firefox tools/gui tools/network tools/online tools/online/greasemonkey tools/puppet unixdaemon

Copyright © 2000-2010 Dean Wilson XML feed logo