bash gurus
Condon Thomas A KPWA
tcondon
Mon May 17 11:33:34 PDT 2004
> -----Original Message-----
> From: Nate Cole [mailto:cole_n_g at yahoo.com]
>
> I have a question for all you bash gurus. I like the way when
> the "up" arrow is pressed, it cycles through the history of
> commands. What I want to do is type a few letters and maybe
> the "right" arrow and have the first history matching the
> letters typed show up. Subsequent "rights" would cycle through
> the other matching history values.
>
> Is this possible?
!xyz...
The bang ('!') tells it to match the first history command (in reverse
order) that starts the same as the characters you type (xyz...). You can
type as many or as few characters after the '!' as you want.
Problems arise when you want to revisit an edit of trash.txt with the vi
editor but the last thing you used it on was /etc/fstab. If you type !v<CR>
you will get the last command beginning with 'v', regardless of whether it
is the one you want or not. The command *will* be executed.
In Harmony's Way, and In A Chord,
Tom :-})
Thomas A. Condon
Barbershop Bass Singer
Registered Linux User #154358
More information about the Linux-users
mailing list