There are a couple of keyboard shortcuts in Ubuntu shell which will save a lot of time if you are comfortable with them.
Delete

  • ctrl+d :D elete the character on the cursor
  • ctrl + h : Delete the character before the cursor
  • ctrl + k : Delete the character after the cursor
  • ctrl + u: Delete all characters before the cursor
  • ctrl + w : Delete the word before the cursor
  • ctrl + y: Restore the deleted characters by ctrl+u .
  • ctrl + ? : Undo the last input
  • alt  + r : Undo the last action
  • alt  + d : Delete the word after the cursor

Move the cursor

  • ctrl + a : Move the cursor to the beginning of the current line.
  • ctrl + e : Move the cursor to the end of the current line.
  • ctrl + left arrow key: Move the cursor to  the beginning of  last word.
  • ctrl+ right arrow key: Move the cursor to the end of  next  word.
  • ctrl + f :Move the cursor to the end of current word.

Others:

  • alt  + u : Change the current word to capital.
  • alt  + l : Change the current word to small letter.
  • alt  + c : Change the first letter of current word to capital.
  • ctrl + r : Input keywords and search command in history.
  • alt  + > : back to the last command.
  • ctrl + l : clear current screen,same to “clear” command
  • ctrl + o : Run command repeatly.
  • alt+number : Run command n times.(n is the number)