Linux has many keyboard shortcuts. Knowing them makes using Linux much easier.
Console/terminal
- -- - shuts down computer
- - (, , ,…) - switch to n-th console
- - or - - switch to next/previous virtual terminal
- - - clears command line from cursor position to end of line.
- - - clears command line from cursor position to beginning of line.
- - - clears word to the left
- - - moves cursor to beginning of command line.
- - command-line autocompletion. Automatically completes current command line.
If autocompletion script is enabled, then also options and applications parameters are autocompleted.
- - 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 - and disabled with -. 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.
- - and - - scrolls console buffer up/down. Works also when is enabled. After changing the terminal (-) buffer contents is erased and it is impossible to scroll it.
- - - screen refresh
Kernel shortcuts
Following shortcuts must be enabled in kernel, they also must be enabled using proc interface (echo 1 > /proc/sys/kernel/sysrq).
- -- - sync all mounted filesystem. Data in buffers is immediately written to disks.
- -- - remounts mounted filesystems read-only
- -- - performs immediate reboot. Don’t do it without syncing and unmounting as it can cause massive filesystem corruption
- --, then --, then -- - attempts to sync all mounted filesystems, remounts them read-only and immediately reboots computer. Fastest way to reboot Linux.
X-Windows shortcuts
- -- or ---
changes screen resolution (higher/lower). Only if X-Windows server is configured for multiple resolutions. - -- - kill X-server. Running applications will be terminated.
- -- (, , ,…) - switches to n-th text console.
Do you know any other shortcuts that are worth to know?