Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have recently discovered that if we press Ctrl+X Ctrl+E, bash opens the current command in an editor (set in $VISUAL or $EDITOR) and executes it when the editor is closed. But it doesen't seem to be documented in the man pages.

share|improve this question
    
Search for edit-and-execute-command in the man page. – n.m. Aug 3 '13 at 7:41
    
Yes, I got it now. – Kartik Aug 3 '13 at 7:44
    
If you use Bash's vi mode, the short cut is Esc, V. I trigger this all the time by accident. Finally learned what it means today :) – mehaase Sep 23 '14 at 14:43
up vote 3 down vote accepted

I have found it out now. I should have read it more carefully before asking this.

The man page says:

edit-and-execute-command (C-xC-e)
          Invoke  an  editor  on the current command line, and execute the
          result as shell commands.   Bash  attempts  to  invoke  $VISUAL,
          $EDITOR, and emacs as the editor, in that order.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.