Bash shortcuts
In the terminal, you’ll typically spend a lot of time in the shell, which is the interactive mechanism for entering commands. On Linux, this usually defaults to the GNU Bourne-Again SHell, or Bash.
Bash has many keyboard shortcuts that can assist in command line editing.
Shortcuts
The very basics:
Ctrl + B to move back one character
Ctrl + F to move forward one character
Backspace to delete the character to the left of the cursor
Ctrl + D to delete the character on the cursor
Ctrl + _, Ctrl + X, or Ctrl + U to undo the last change
Movement:
Ctrl + A to move to the start of the line
Ctrl + E to move to the end of the line
Alt + F to move forward a word
Alt + B to move backward a word
Ctrl + L to clear the screen
Deletion:
Ctrl + K - delete the text until the end of the line
Alt + D - delete the text until the end of the word
Alt + W - delete the text until the beginning of the word