3 ms·
Ctrl-R is by far the most useful one for me.
by rzimmerman 12y ago
Ctrl-R is by far the most useful one for me.
- cmatteri 12y agoThe article doesn't say, so it's worth mentioning that you can type ctrl-R multiple times to search further back into command history.
- aatos 12y agoIt doesn't mention either that you can search to the other direction by pressing ctrl-s (usually it also sends the stop signal which should be removed by "stty -ixon"). Very useful if you go past the entry you are looking for.
- danielweber 12y agoI use C-r constantly. But sometimes I need to find a command, and then edit it before running it. What is the proper way to exit "search mode" and go into the normal "edit" mode?
- morsch 12y agoAny movement key will do the trick. I usually use cursor-right or the end key. It's so ingrained I had to actually do it in a shell to know what it was I did.
- danielweber 12y agoISTR pressing one of those keys would obliterate the part of my line where I was writing, putting in ^B characters. I can't replicate it now on my test box; it works exactly the way you say it should. It may be a terminal issue; I'm currently on Windows using cygwin to ssh to Linux.
- aatos 12y agoC-g (as in quit https://www.gnu.org/software/emacs/manual/html_node/emacs/Quitting.html https://www.gnu.org/software/emacs/manual/html_node/emacs/Qu...) is the 'proper' way but yeah, not the only one.
- danielweber 12y agoThat just wipes out the whole line (on my test box).
- platz 12y agoC-e ?
- JonnieCache 12y agoCtrl-P autocompletes from your history too. It works like Ctrl-R but after you've already started typing, if you see what I mean. This might be a zsh thing though.
- uulbiy 12y agoCtrl-p in emacs takes you to the previous line. Since readline uses emcs-style notation by default, Ctrl-p takes you to the previous command in history (and Ctrl-n to the next). I don't know about zsh though. Also, other emacs keys work like back: ctrl-b, meta-b, forward: ctrl-f, meta-f, start of line: ctrl-a, end of line: ctrl-e etc.
- buerkle 12y agoI like this in my ~/.inputrc "\e[A":history-search-backward "\e[B":history-search-forward Type a few characters and hitting the arrow keys will show only commands that match those first few characters.