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.

0
2019-05-06 21:54:00
Source Share
Answers: 11

If you add the complying with to ~/.inputrc

"\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.)

0
2019-05-12 06:44:04
Source

If you add stty -ixon to your ~/.bashrc documents after that Ctrl - s will certainly enter the contrary instructions to Ctrl - r.

0
2019-05-12 04:32:11
Source

There is a means to make use of Ctrl - R with tcsh . Add the adhering to in your ~/.cshrc:

bindkey "^r" i-search-back (it is simply a caret indicator and also the letter r)

That's the largest convenience for me.

0
2019-05-12 04:21:17
Source

If you type !ls after that slam will certainly browse your background and also execute one of the most current command that starts with "ls"

0
2019-05-10 14:18:47
Source

Yes it exists, at the very least if you are making use of zsh. Simply start keying the command and afterwards press M-p (ESC p) and also it will certainly locate previous commands that matches what you keyed in. Press it once more to locate the next suit.

0
2019-05-10 13:40:05
Source

When making use of Bash, type Control - R and afterwards start keying. Keying in Control - R repetitively after inputting some message will certainly relocate you back in matching command lines.

0
2019-05-10 13:35:29
Source

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

!foo

will certainly execute the last command that begins with foo and also

!?foo

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.

0
2019-05-10 13:34:24
Source

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).

0
2019-05-08 19:38:25
Source

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, or !?string?, which runs one of the most current command which contains string.

(I assume that's the only things pertinent to this inquiry, yet I covered far more of the background regulates in this answer)

0
2019-05-08 19:21:39
Source

I make use of adhering to 2 a lot of the moment.
Yet please note both of them look for beginning chars.

  1. 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.
  2. 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.

0
2019-05-08 19:19:56
Source

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.

0
2019-05-08 19:17:55
Source