views:

730

answers:

5

This is one of those questions where it is easier to ask someone else instead of spending thirty minutes trying to "guess" for the correct place in the documentation or search engine terms:

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

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"

Giancarlo
you don't know, yet you know? %-|
hop
A: 

Try this. Type Alt 4, then type T, then hit Enter.

Editted to use the snazzier HTML.

Sean Bright
+2  A: 

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.

Cirno de Bergerac
+5  A: 

The term you want to google for is

"readline arguments"

This will lead to, for example, this 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.

For that to work, you have to know where the Meta key is mapped: sometimes it's Alt, sometimes it's Esc, cool computers have a dedicated Meta key ;)

hop
A: 

bash manual section - basically a way of repeating readline commands, or reversing them.

Douglas Leeder