Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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

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
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
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

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.