Press alt + numeric in bash and you get (arg [numeric]) what is that?

Press alt + numeric in bash and you get (arg [numeric]) what is that?

(This type of question is better suited for asking a human, instead of trying to "guess" for the correct terminology to search on the documentation via internet).

23488 次浏览

I don't know but when you do alt + numeric and then you press a character, you'll get num caracters: (arg: 123) + a -> 123 times "a"

试试这个。键入 Alt 4,然后键入 T,然后按 Enter

编辑使用时髦的 HTML。

It repeats the next command given that many times, same as in Emacs. E.g. M-1-0 C-p moves back 10 history items. M-4 C-h backspaces four characters, M-3 M-t moves the previous word forward three times, and so on. Here I use M- meaning "meta" for the Alt key, as is the custom in Bash.

你想用谷歌搜索的术语是:

"readline arguments"

这将导致,例如,这个 Bash 参考手册中的一章:

You can pass numeric arguments to Readline commands. Sometimes the argument acts as a 重复计数, 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'.

将数值参数传递给命令的一般方法是在命令之前键入元数字。如果输入的第一个“数字”是负号(’-’) ,那么参数的符号就是负号。键入一个元数字以启动参数后,可以键入数字的其余部分,然后键入命令。例如,为了给 C-d 命令一个10的参数,您可以键入 M-10 C-d’,这将删除输入行中接下来的10个字符。

要做到这一点,你必须知道 Meta 密钥映射在哪里: 有时是 Alt,有时是 Esc,很酷的计算机有一个专用的 Meta 密钥;)

对于不熟悉语法的人来说,“ M —— C-k”等同于 Meta_key + - Ctrl + k。“ M”是 Meta 键的速记,如前所述,Meta 键因系统而异,“ C”是 Ctrl 键的速记。字符(如“ M-”)后面的“-”不是您键入的内容,而是指示同步按键的一种方式。

Bash 手册部分 -基本上是一种重复读取命令或者反转它们的方法。

In order to repeat numeric characters - e.g. 128 zeroes, hit the following:

Meta-key + 1 2 8 Ctrl + v 0

我知道这已经有了一个公认的答案,但是我确实发现了一些 有用的例子,除了简单的重复字符之外,它还演示了其他用途。数字参数可以应用于各种各样的事情。例如序列“ Alt + 3,Escape,Backspace”将向后删除3个单词。