Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Other than Ctrl + A and Ctrl + E to jump to the front or end of the command-line, what other things can you do?

Is it possible to delete the entire line? Or to the next or pervious word in the line?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

Some useful commands

  • Ctrl + A: Beginning of line

  • Ctrl + E: End of line

  • : Previous command

  • : Next command

  • Crtl + C: Cancel command

  • Crtl + : Forward one word

  • Crtl + : Backward one word

  • Crtl + D: Delete current character

  • Crtl + W: Delete the last word

  • Crtl + T: Swap current character with the previous character

  • Crtl + K: Cut everything after the cursor

  • Crtl + U: Cut everything before the cursor

  • Crtl + Y: Paste the last cut text

  • Crtl + _: Undo

  • Crtl + S: Stop writing output to the screen

  • Crtl + Q: Start writing output to the screen

  • Crtl + L: Clear the screen

share|improve this answer
    
nice, is there a cut everything before the cursor? –  Blankman Nov 2 '11 at 3:43
    
@Blankman Not that I know of. I tried out a bunch of possibilities but nothing seems to do it. Odd that they wouldn't have it. –  Kris Harper Nov 2 '11 at 18:26
1  
Ctrl-U cuts everything before the cursor. You can find the full list of keybindings in the bash manual page, several pages down (search for "Readline Command Names"). –  Marius Gedminas Nov 2 '11 at 19:48
    
@MariusGedminas Weird, I could have sworn I tried that. I've updated by answer. Thanks for your help. –  Kris Harper Nov 2 '11 at 19:55
add comment

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.