Linux Keyboard_shortcuts

本文详细介绍了Linux系统中各种实用的快捷键,包括内核级快捷键、终端操作、虚拟控制台切换等,帮助用户更高效地管理和调试系统。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Standard shortcuts

Kernel

There are several low level shortcuts that are implemented in the kernel which can be used for debugging and recovering from an unresponsive system. Whenever possible, it is recommended that you use these shortcuts instead of doing a hard shutdown (holding down the power button to completely power off the system).

To use these, they must first be activated with either sysctl kernel.sysrq=1 or echo "1" > /proc/sys/kernel/sysrq. If you wish to have it enabled during boot, edit /etc/sysctl.d/99-sysctl.conf and insert the text kernel.sysrq = 1. If you want to make sure it will be enabled even before the partitions are mounted and in the initrd, then add sysrq_always_enabled=1 to your kernel parameters.

A common idiom to remember this is "Reboot Even ISystem Utterly Broken" (also referred to as "REISUB"). Alternatively, think of it as "BUSIER" backwards.

Keyboard Shortcut Description
Alt+SysRq+r UnrawTake control of keyboard back from X.
Alt+SysRq+e TerminateSend SIGTERM to all processes, allowing them to terminate gracefully.
Alt+SysRq+i KillSend SIGKILL to all processes, forcing them to terminate immediately.
Alt+SysRq+s SyncFlush data to disk.
Alt+SysRq+u UnmountUnmount and remount all filesystems read-only.
Alt+SysRq+b RebootReboot
Tip:
  • If you are using a display manager and after Alt+SysRq+e you are presented with the login screen (or full desktop if autologin is enabled), it is most likely caused by Restart=always directive in the relevant service file. If necessary, edit the unit, however this should not prevent the "REISUB" sequence from working.
  • If all the above combinations work except Alt+SysRq+b, try using the contralateral Alt key.
  • On laptops that use Fn key to differentiate SysRq from PrtScrn, it may not actually be necessary to use the Fn key (i.e., Alt+PrtSc+letter could work).
  • On Lenovo laptops SysRq is often configured as Fn+S. To use it press and hold Alt then press Fn+srelease Fn and s still holding Alt followed by the keys above.
  • You may need to press Ctrl along with Alt. So for example, full key shortcut would be Ctrl+Alt+SysRq+b.

See Wikipedia:Magic SysRq key for more details.

Terminal

Virtual console

See Wikipedia:Virtual console

Keyboard Shortcut Description
Ctrl+Alt+DelReboots Computer (specified by the symlink /usr/lib/systemd/system/ctrl-alt-del.target)
Alt+F1F2F3, ...Switch to n-th virtual console
Alt+ ←Switch to previous virtual console
Alt+ →Switch to next virtual console
Scroll LockWhen Scroll Lock is activated, input/output is locked
Shift+PgUp/PgDownScrolls console buffer up/down
Ctrl+cKills current task
Ctrl+dInserts an EOF
Ctrl+zPauses current Task
Readline

GNU readline is a commonly used library for line-editing; it is used for example by Bash, FTP, and many more (see the details of readline package under "Required By" for more examples). readline is also customizable (see man page for details).

Keyboard Shortcut Description
Ctrl+lClear the screen
Cursor Movement
Ctrl+bMove cursor one character to the left
Ctrl+fMove cursor one character to the right
Alt+bMove cursor one word to the left
Alt+fMove cursor one word to the right
Ctrl+aMove cursor to start of the line
Ctrl+eMove cursor to end of the line
Copy & Paste
Ctrl+uCut everything from line start to cursor
Ctrl+kCut everything from the cursor to end of the line
Alt+dCut the current word after the cursor
Ctrl+wCut the current word before the cursor
Ctrl+yPaste the previous cut text
Alt+yPaste the second latest cut text
Alt+Ctrl+yPaste the first argument of the previous command
Alt+./_Paste the last argument of the previous command
History
Ctrl+pMove to the previous line
Ctrl+nMove to the next line
Ctrl+sSearch
Ctrl+rReverse search
Ctrl+jEnd search
Ctrl+gAbort search (restores original line)
Alt+rRestores all changes made to line
Completion
TabAuto-complete a name
Alt+?List all possible completions
Alt+*Insert all possible completions

X11 & Wayland

Keyboard Shortcut Description Notes
Ctrl+Alt+F1F2F3, ...Switch to n-th virtual consoleIf it does not work, try Ctrl+Fn+Alt+F….
Shift+Insert 
Mouse Button 2
Paste text from the PRIMARY bufferBy default, Qt maps Shift+Insert to CLIPBOARD instead of the PRIMARY buffer (see e.g. [1]) and Ctrl+Shift+Insert is mapped to the PRIMARY buffer.

More reference: https://wiki.archlinux.org/index.php/Keyboard_shortcuts

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值