Ubuntu - Keyboard shortcuts to be used in a terminal

December 2016




As a linux user, you will certainly make an intensive use of command lines. To optimize your time and gain in efficieny, here are some keyboard shortcuts to navigate through your commands typed in a terminal.
  • ALT-R: Undo all changes made to a command line.
  • ALT+CTRL+E: Expand a command line.
  • CTRL+R: Incremental search of history.
  • ALT+P: Non-incremental search of history.
  • CTRL+A: Move at the beginning of the line.
  • CTRL+E: Move to the end of the line.
  • CTRL+U: Delete items from the cursor position to the beginning of the line.
  • CTRL+K Delete items from the cursor position to the end of the line.
  • CTRL+W: Delete items from the cursor position to the start of the word.
  • CTRL+Y: Paste text from the clipboard.
  • CTRL+L: Clear the screen.Only the selected line will be displayed
  • !!: Execute the last command in history
  • !xxx: Run the last command in history starting with xxx (replace x with the command of your choice)
  • !n: Execute the nth command in history

Related :

This document entitled « Ubuntu - Keyboard shortcuts to be used in a terminal » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.