bash - 在 bash 中按 alt + numeric 会得到 (arg [numeric]) 那是什么?

标签 bash shell keyboard-shortcuts readline

在 bash 中按 alt + numeric 会得到 (arg [numeric]) 那是什么?

(这类问题更适合问人,而不是试图“猜测”正确的术语以通过互联网搜索文档)。

最佳答案

您要搜索的字词是:

"readline arguments"

这将导致,例如,这个 chapter from the bash reference manual :

You can pass numeric arguments to Readline commands. Sometimes the argument acts as a repeat count, other times it is the sign of the argument that is significant. If you pass a negative argument to a command which normally acts in a forward direction, that command will act in a backward direction. For example, to kill text back to the start of the line, you might type 'M-- C-k'.

The general way to pass numeric arguments to a command is to type meta digits before the command. If the first 'digit' typed is a minus sign ('-'), then the sign of the argument will be negative. Once you have typed one meta digit to get the argument started, you can type the remainder of the digits, and then the command. For example, to give the C-d command an argument of 10, you could type 'M-1 0 C-d', which will delete the next ten characters on the input line.

为此,您必须知道 Meta 键的映射位置:有时是 Alt,有时是 Esc,很酷的计算机有专用的 Meta 键 ;)

对于那些不熟悉语法的人来说,'M-- C-k' 相当于 Meta_key+- Ctrl+ k。 “M”是 Meta 键的简写,如前所述,它因系统而异,“C”是 Ctrl 键的简写。字符后的“-”(如“M-”)不是您键入的内容,它是表示同时按键的一种方式。

关于bash - 在 bash 中按 alt + numeric 会得到 (arg [numeric]) 那是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/562115/

相关文章:

bash - 当 bash 函数具有相同名称时调用程序

c# - WPF Windows 快捷方式帮助

bash - zsh 中奇怪的 "jobs"行为

linux - 如何使用 "getopts"选项下的 2 个参数调用函数

linux - 将文件夹系统中的所有 .docx 转换为 .odt,然后删除所有 .docx 文件

c# - 用于查看/应用可用重构的键盘快捷键

keyboard-shortcuts - AwesomeWM urxvt 通过键盘粘贴剪贴板

linux - 不使用 awk 或 sed 对字符串进行排序

bash getopts 多个参数或默认值

linux - 如何通过 shell 拆分此文本文件?