ideal means to look my shell's background
Exists a far better means to look my background apply for a command than grep? I do have some suggestion what the command begins as, yet I do not recognize just how much back in the background it is.
upgrade: was previously zsh details yet as a result of overlapping solutions do not hesitate to address for any kind of shell (or setting (vi/emacs) ) below, simply keep in mind if it specifies.
If you add the complying with to
"\e[5~": history-search-backward "\e[6~": history-search-forward
and also reactivate Bash, you can start keying, and afterwards make use of Page Up and also Page Down to relocate in reverse and also onward via the background of lines beginning with the very same prefix you simply keyed in.
(Some might favor to make use of
\e[A and also
\e[B, which will certainly change the regular Up and also Down activities as opposed to binding new keys.)
The interactive punctual conjured up by Ctrl - R, which had actually been currently stated, is one of the most hassle-free means. In addition it's preferred to remap Up and also Down arrowhead keys to search the background for a prefix presently on the command line, nonetheless this calls for some changes to the .
The timeless and also much less interactive remedy is to make use of shell background development. Keying in
will certainly execute the last command that begins with
foo and also
will certainly execute the last command which contains
foo. Even more details concerning background development can be located in the Bash reference manual, thinking your shell is Bash or suitable.
could be zsh details. In looking into this answer I found
vi-history-search-backward which permits one to look with / in vi setting (which I really did not state I remained in) you can after that make use of n and also N to look onward and also in reverse specifically (after pushing enter).
Ctrl+R is generally the most effective means, as descriptor said. You can additionally make use of
!string, which runs one of the most current command beginning with
!?string?, which runs one of the most current command which contains
(I assume that's the only things pertinent to this inquiry, yet I covered far more of the background regulates in this answer)
I make use of adhering to 2 a lot of the moment.
Yet please note both of them look for beginning chars.
- tcsh : type some couple of charecters of the command after that Esc+p it will certainly show the previous command beginning with that said key series press it once more it will certainly show an additional command.
- ksh : usage
fc -e - <SPACE>
<first few char for your previous >this will certainly run last command matching that series.
I was unable to locate something like Ctrl+R in Bash for my ksh and also tcsh.
Not certain if this will certainly aid, yet I such as to make use of ctrl - r and afterwards start keying the command. It needs to experience your background and also existing you with the first suit. To toggle via the suits simply struck ctrl - r once more.