![]() Other shells, like dash may not have an editing library to understand this keys (unless compiled with the -with-libedit option enabled). ![]() The line editor (where you type your commands) is provided directly by ksh, by the library readline in bash, and by the library zle in zsh. There are several layers in which you can ask for the last command. (Unfortunately, it does not seem to support named buffers.) So you can accomplish results comparable to !-2:- !$. ![]() For advanced users: you can even copy ( yank) text from one line. ![]() So, for example, Esc k i s u d o Space Enter is equivalent to sudo !!. To actually add to the command from history. So you will need to use a vi editing command Remember, you will still be in vi command mode, To re-execute the 12th previous command (same as !-12).Īnd then edit the bash command line you find there. The minus key - also works as a "move up" command. To re-execute the previous command (same as !!). (a tiny subset) Up Ctrl+PĪlternatively, you could set up your shell to use vi command editing mode, by adding set -o vi to your shell startup file (e.g., ~/.bashrc). Most shells that have a command line editing feature
0 Comments
Leave a Reply. |