[aklug] Re: Tip Jar: Search through bash history

From: Greg Schmitz <greg@amipa.org>
Date: Tue Feb 03 2015 - 00:40:50 AKST

On 02/01/2015 12:51 PM, Mike wrote:
>
> For the longest time when using bash, I've used the up arrow key to
> get to previous commands. This had gotten tiring, so I searched out a
> way to find a previous command without having to hit up arrow so many
> times.
>
> I found this article:
> http://ruslanspivak.com/2010/11/20/bash-history-reverse-intelligent-search/
>
> The basic idea is you can press CTRL-R and then start typing the
> command you are looking for.
>
>
> For example, if it was a git command, you can type:
>
> CTRL-R git
>
> Then it will look backwards through your history to find the most
> recent git command.
>
> If you hit CTRL-R during that, it will find the one before that.
>
> Give it a try!! It is really nice way to go back in time!
>
> Also, if things seem a little wonky, you can hit CTRL-G and you will
> be back to normal.
>
> Mike B.
> ---------
> To unsubscribe, send email to <aklug-request@aklug.org>
> with 'unsubscribe' in the message body.
>

BASH is very powerful - it is for getting things done and can be used
for many tasks. Here's a title that you might find of interest
(applicable even if you are working at the command line):

Johnson, Chris F.A. PRO BASH PROGRAMMING; SCRIPTING THE GNU/LINUX
SHELL. Apress, 2009. ISBN: 978-1-4302-1997-2 [UAA: QA 76.76.063 J64
2009]

--greg

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Tue Feb 3 00:41:23 2015

This archive was generated by hypermail 2.1.8 : Tue Feb 03 2015 - 00:41:23 AKST