Linux 常用快捷键

Posted by dengwei

Console/terminal

  • Ctrl-Alt-Delete - shuts down computer
  • Alt-Fn (F1, F2, F3,…) - switch to n-th console
  • Alt-Left or Alt-Right - switch to next/previous virtual terminal
  • Ctrl-K - clears command line from cursor position to end of line.
    Example of use: CTRL-K
  • Ctrl-U - clears command line from cursor position to beginning of line.
  • Ctrl-Y - will paste in anything that was deleted by Ctrl-U or Ctrl-K
  • Ctrl-W - clears word to the left
  • Ctrl-A - moves cursor to beginning of command line.
  • Tab - command-line autocompletion. Automatically completes current command line.
    Example of use: autocompletion using TAB

    If autocompletion script is enabled, then also options and applications parameters are autocompleted.

  • Scroll Lock - locks terminal input/output - allows to read console contents when output is going too fast. To unlock, press Scroll Lock once again.

    Alternatively, Scroll Lock can be enabled using Ctrl-S and disabled with Ctrl-Q. Try last shortcut if your console hangs for unknown reason - it happened to me many times that I’ve locked it accidentaly by pressing CTRL-S.

  • Shift-Page Up and Shift-Page Down - scrolls console buffer up/down. Works also when Scroll Lock is enabled. After changing the terminal (Alt-Fn) buffer contents is erased and it is impossible to scroll it.
  • Ctrl-L - screen refresh
  • Ctrl-C or Ctrl-Backslash - kills current task

Kernel shortcuts

Following shortcuts must be enabled in kernel, they also must be enabled using proc interface (echo 1 > /proc/sys/kernel/sysrq).

  • Alt-SysRQ-S - sync all mounted filesystem. Data in buffers is immediately written to disks.
  • Alt-SysRQ-U - remounts mounted filesystems read-only
  • Alt-SysRQ-B - performs immediate reboot. Don’t do it without syncing and unmounting as it can cause massive filesystem corruption
  • Alt-SysRQ-S, then Alt-SysRQ-U, then Alt-SysRQ-B - attempts to sync all mounted filesystems, remounts them read-only and immediately reboots computer. Fastest way to reboot .

X- shortcuts

  • Ctrl-Alt-Plus or Ctrl-Alt-Minus-
    changes screen resolution (higher/lower). Only if X- is configured for multiple resolutions.
  • Ctrl-Alt-Backspace - kill X-. Running applications will be terminated.
  • Ctrl-Alt-Escape - xkill - click an application to kill it.
  • Ctrl-Alt-Fn (F1, F2, F3,…) - switches to n-th text console.

Leave a Reply