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.

Possible Duplicate:
Keyboard shortcuts in Bash shell

Is there any way I can undo an auto-completion done by bash? For example:

$> ls first/second/t
<Presses tab>
$> ls first/second/third
<realizes it should be fourth and not third>
<presses backspace key till initial prompt is reached>
$> ls first/second/

Is there any way I can replace the irritating backspacing part with some cool combo which undoes the most recent auto-completion?

share|improve this question

marked as duplicate by Nifle, Diago Oct 3 '10 at 9:10

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

add comment

2 Answers 2

up vote 1 down vote accepted

try undo with Ctrl + _

also Ctrl + W may do what you want. It deletes last word.

share|improve this answer
    
It works.:) Though for every undo required the CTRL + _ combo has to be pressed twice! Once for undoing the additional space char and the second one to actually undo the suggestion. Any workarounds for this? If not, I'll mark this post as the chosen one. ;-) –  sasuke Oct 2 '10 at 18:02
    
Try deleting last word with Ctrl + W –  Casual Coder Oct 2 '10 at 18:23
    
I guess there is no single command for the same (CTRL + W and then CTRL + _). Anyways, this should be enough for the time being; solved. Thanks. –  sasuke Oct 2 '10 at 18:29
2  
Remember that you can customize such behaviors by editing ~/.inputrc, see man readline for more info and /etc/inputrc to see the default configuration. –  cYrus Oct 2 '10 at 18:47
    
@cYrus: Ooh, I didn't know that; though looking at the file makes me feel that changing it would be something pretty hardcore. Skipped for the time being. :-) –  sasuke Oct 2 '10 at 19:10
add comment

Also try Alt + B and Alt + F (moves backwards and forward). Then you can press Ctrl + K to delete everything from the cursor to the end of the line

share|improve this answer
add comment

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