[TriLUG] history

William Sutton william at trilug.org
Mon Feb 23 13:10:20 EST 2004


Along the same lines is the !?string

While !string grabs the last command that started with "string", !?string 
grabs the last command where "string" occurred.  That is, "string" could 
be in the middle of your command and it will still pick it up.

For example,

ls -l |cut -c51- may be entry 120..

you could do !120 oooor...

!?cut

:)

is that slick?

William

On Mon, 23 Feb 2004, Joseph Tate wrote:

> Stephen Hoffman wrote:
> 
> > Got a question about functionality that may or may not exist, but I
> > certainly don't want to start writing programs that already exist...
> > 
> > I want to be able to use the commands out of "history".  When I type a
> > long drawn out command one time I want to be able to call that same
> > command much like bash does with tab completion or to be able to
> > re-execute entry #100 but don't really want to alias it.  This may seem
> > lazy, but I am not one for jumping from keyboard to mouse back to
> > keyboard...I want to use one or the other...and some systems don't even
> > have a mouse.
> > 
> > Does this functionality exist under another name or exist at all?  RTFM
> > produced little on "history", Where else can I look?
> > 
> > TIA,
> > Steve
> 
> !100 will execute item 100 in your command history.  I generally do a 
> history | grep something, and then !thenumber
> 
> Joseph
> 




More information about the TriLUG mailing list