sangkrit

Command Line Keyboard Tricks


Other than moving cursor with arrow keys there are much more useful keyboard tricks in Linux command line:

  • Ctrl-a Move cursor to the beginning of the line.
  • Ctrl-e Move cursor to the end of the line.
  • Ctrl-f Move cursor forward one character; same as the right arrow key.
  • Ctrl-b Move cursor backward one character; same as the left arrow key.
  • Alt-f Move cursor forward one word.
  • Alt-b Move cursor backward one word.
  • Ctrl-l Clear the screen and move the cursor to the top left corner. Its same as ‘clear’ command
  • Ctrl-d Delete the character at the cursor location
  • Ctrl-t Transpose (exchange) the character at the cursor location with the one preceding it.
  • Alt-t Transpose the word at the cursor location with the one preceding it.
  • Alt-l Convert the characters from the cursor location to the end of the word to lowercase.
  • Alt-u Convert the characters from the cursor location to the end of the word to uppercase.
  • Ctrl-k Kill text from the cursor location to the end of line.
  • Ctrl-u Kill text from the cursor location to the beginning of the line.
  • Alt-d Kill text from the cursor location to the end of the current word.
  • Alt- Backspace Kill text from the cursor location to the beginning of the current word. If the cursor is at the beginning of a word, kill the previous word.
  • clear – Clears the screen
  • history – Display the history list


Leave a Reply