[PLUG] Saving terminal commands

Galen Seitz galens at seitzassoc.com
Thu Feb 5 20:00:09 UTC 2009


John Jason Jordan wrote:
> On 05 Feb 2009 10:05:45 -0800
> Russell Senior <russell at personaltelco.net> dijo:
> 
>>>>>>> "wes" == wes  <plug at the-wes.com> writes:
>> wes> Hit CTRL+R again.
>>
>> And if you go too far, you can use backspace to step back to the one
>> you want, and then munge as needed from there.  
> 
> I like Ctrl-r. It gives me the command, but doesn't run it. Thus, I can
> get a previous command and edit it before running it. It also takes
> less typing than the history command. Using ! is even shorter, but it
> automatically runs the command.
> 
> I don't suppose there is a way to make Ctrl-r skip the first word, or
> specifically the word "sudo" when it searches? It would saving having
> to type the word every time.

???  I'm not sure what you mean.  C-r searches for strings appearing 
anywhere in your history.  The search does *not* start at the 
beginning of each line in your history.

Given this in your history:
  echo foo bar baz
  echo fee fie foe fum
typing C-r f brings up the last echo command.  Continuing with an o, 
nothing changes.  Continuing with a second o gets you the first echo 
command.

-- 
Galen Seitz
Seitz & Associates
galens at seitzassoc.com



More information about the PLUG mailing list