Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Is there any way to undo edition of command in terminal? E.g. I have a long string which I edited before running a command, and I want to undo some of those edits before pressing ENTER.

share|improve this question
up vote 3 down vote accepted

If you activate vi or emacs mode (set -o emacs or set -o vi ) you can use many advanced features like 'undo'. The default is emacs mode, so ctrl-_ should already do an undo.

share|improve this answer
+1. as this is handled by bash's Readline facility, the OP might be interested in this answer that provides some of the basics of bash shortcuts:… .. another answer to that question provides this link for bash's vi mode: – quack quixote Mar 4 '10 at 23:15

Your Answer


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.