gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-29 08:39:02 27 4
gpt4 key购买 nike

在 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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com