Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

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: superuser.com/questions/113103/… .. another answer to that question provides this link for bash's vi mode: hypexr.org/bash_tutorial.php#vi –  quack quixote Mar 4 '10 at 23:15

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.