How many times do you find yourself using the arrow keys to move to the beginning or end of the command line in a bash terminal? Do you use backspace to delete every single character to clear what you’ve typed? If you answered “yes” to either of these questions, continue reading.

I have been doing this a lot myself because I couldn’t remember the shortcut keys for these tasks. So, I decided to write them here for future reference. While you can easily find more thorough information on the web, here are some useful shortcuts.

Key SequenceDescription
Ctrl + UCut the text from the cursor to the start of the line.
Alt + DCut the word after the cursor.
Alt + BackspaceCut the word before the cursor.
Ctrl + AMove the cursor to the start of the line.
Ctrl + EMove the cursor to the end of the line.
Ctrl + Left ArrowMove the cursor one word to the left.
Ctrl + Right ArrowMove the cursor one word to the right.

I hope these shortcuts save you some time and your fingers from getting sore.