Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Oct 2016 20:02:30 +0200
From:      Sascha Folie <sascha.folie@safo.at>
To:        freebsd-questions@freebsd.org
Subject:   Re: csh history search
Message-ID:  <20161024200230.5b6edab3b54c065ea171eff2@safo.at>
In-Reply-To: <99ed60e6-2132-943e-262b-1a237a6f578f@citrin.ru>
References:  <580E2B4F.4000003@gmail.com> <99ed60e6-2132-943e-262b-1a237a6f578f@citrin.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 24 Oct 2016 11:52:00 -0400
Anton Yuzhaninov <citrin+bsd@citrin.ru> wrote:
> On 10/24/16 11:39, Ernie Luzar wrote:
> > Lets say that a while back I issued this command
> > ping -c 4 hometown.jones.domain.com
> >
> > Now I would like to retrieve that domain name from the history list.
> >
> > On the command line I enter  !?jon
> > The complete ping command is retrieved and automatically executed.
> >
> > I don't want the found command automatically executed, I just want the
> > found command inserted to the command line being visible so I can
> > manually modify it before choosing to execute it.
> 
> If you have
> 
> bindkey -k up history-search-backward
> bindkey -k down history-search-forward
> 
> in ~/.cshrc (there by default in FreeBSD)
> 
> your can type
> *jon*
> and then using up/down arrows list all history entries matched by *jon* 
> and edit lime before executing.
> 
> See
> man tcsh
> /history-search-backward
> for more info.

You can also add 

bindkey "^R" i-search-back

to ~/.cshrc to enable CTRL+r search (like bash).



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20161024200230.5b6edab3b54c065ea171eff2>