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

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

(This type of question is better suited to asking a person, rather than trying to "guess" the correct terminology for searching documentation online.)

+59
bash shell readline keyboard-shortcuts
Feb 18 '09 at 17:44
source share
7 answers

The term you want to use for google for:

"readline arguments" 

This will lead, for example, to this chapter of the bash reference manual :

You can pass numeric arguments to Readline commands. Sometimes an argument acts like a repeat count ; in other cases, it is the sign of a significant argument. If you pass a negative argument to a command that usually acts in the forward direction, this command will act in the opposite direction. For example, to kill text before the beginning of a line, you can enter "M-- Ck".

A common way to pass numeric arguments to a command is to enter metadata before the command. If the first digit entered is a minus sign ('-'), the sign of this argument will be negative. Once you have typed one meta sign to start the argument, you can enter the rest of the numbers, and then the command. For example, to give the Cd command an argument of 10, you can enter "M-1 0 Cd", which will remove the next ten characters in the input line.

To do this, you need to know where the meta key is displayed: sometimes it is Alt , sometimes it is Esc , cool computers have a dedicated meta key;)

+40
Feb 18 '09 at 18:00
source share

To repeat numeric characters - for example, 128 zeros, press the following:

Meta-key + 1 2 8 Ctrl + v 0

+13
Jul 20 2018-12-12T00:
source share

Try it. Type Alt 4 , then type T , then press Enter .

Edited to use vibrant HTML.

+7
Feb 18 '09 at 17:51
source share

It repeats the following command given many times, as in Emacs. For example. M-1-0 Cp returns 10 elements of the story. M-4 Ch backspaces four characters, M-3 Mt moves the previous word forward three times, etc. Here I use M- , which means β€œmeta” for the Alt key, as is custom in Bash.

+6
Feb 18 '09 at 17:58
source share
+4
May 28 '13 at 9:15
source share

I don’t know, but when you do alt + numeric and then press a character, you will get a few characters: (arg: 123) + a β†’ 123 times "a"

+3
Feb 18 '09 at 17:46
source share

The bash section of the manual is basically a way of repeating readline commands or modifying them.

+1
Feb 18 '09 at 18:01
source share



All Articles