Is it possible to use emacs bindings in 开发者_StackOverflow社区bash shell with numeric arguments, for example in emacs C-u 5 C-d deletes five characters. Is there an equivalent way of doing the same in bash prompt?
Thanks
Emacs is usually the default editing mode (set -o emacs).
From Introduction to Line Editing and Readine Arguments:
The text C-k is read as 'Control-K' and describes the character produced when the Control key is depressed and the k key is struck.
The text M-k is read as 'Meta-K' and describes the character produced when the meta key (if you have one) is depressed, and the k key is struck. If you do not have a meta key, the identical keystroke can be generated by typing ESC first, and then typing k. Either process is known as metafying the k key.
The general way to pass numeric arguments to a command is to type meta digits before the command. For example, to give the C-d command an argument of 10, you could type M-1 0 C-d.
Bash Emacs Editing Mode (readline) Cheat Sheet
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论