Wed. Jul 15th, 2020

Linux terminal shortcuts

2 min read

There are many shortcuts in the Linux command line, such as Ctrl + l to clear the screen, Ctrl + C to interrupt the command, Ctrl + Z to pause the command, etc. After mastering these shortcuts, you will find that using the command line in Linux becomes more convenient and simpler.

The Linux console is a system console internal to the Linux kernel (a system console is the device which receives all kernel messages and warnings and which allows logins in single user mode). The Linux console provides a way for the kernel and other processes to send text output to the user, and to receive text input from the user. The user typically enters text with a computer keyboard and reads the output text on a computer monitor. The Linux kernel supports virtual consoles – consoles that are logically separate, but which access the same physical keyboard and display.[3] The Linux console (and Linux virtual consoles) are implemented by the VT subsystem of the Linux kernel, and do not rely on any user space software. This is in contrast to a terminal emulator, which is a user space process that emulates a terminal, and is typically used in a graphical display environment.

  1. ↑ or Ctrl + p displays the previous command
  2. ↓ or Ctrl + n to display the next command
  3. → or Ctrl + f to move the cursor one character to the right
  4. ← or Ctrl + b moves the cursor one character to the left
  5. Alt + f cursor to the right
  6. Alt + b cursor one word to the left
  7. Ctrl + r search backward for commands that include the input string. Continue pressing Ctrl + r, then search up again. Use Ctrl + c to interrupt the command.
  8. Ctrl + s search forward for commands that include input font strings, the same usage as Ctrl + r
  9. Ctrl + a cursor to the beginning
  10. Ctrl + l clear screen
  11. Ctrl + u cut all characters before the cursor
  12. Ctrl + k cut all characters after the cursor
  13. Ctrl + w cut the word before the cursor (space, punctuation, etc. as separators)
  14. Ctrl + y Paste
  15. Ctrl + c interrupt command
  16. Ctrl + s suspend the current shell
  17. Ctrl + q re-enable a suspended shell
  18. Ctrl + Z to pause the command
  19. Alt + u capitalize the word at the cursor (from the cursor to the end of the word)
  20. Alt + l convert the word under the cursor to lowercase (from the cursor to the end of the word)
  21. Alt + c capitalize the word at the cursor (from the cursor to the end of the word)