Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Fast command history scrolling in Terminal' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Fast command history scrolling in Terminal
Authored by: azraq27 on Dec 01, '04 12:24:54PM

Wow, that control-R thing is great! I've never seen that before.

I always use "history | grep [text]" to find previous commands, and then !### to reuse them.

For example:
Lotus:~ bill$ history | grep ssh
480 ssh me@test
Lotus:~ bill$ !480

That command-R thing is sweet.



[ Reply to This | # ]
Fast command history scrolling in Terminal
Authored by: erikh on Dec 01, '04 04:26:46PM

Note that if you know what you're goign to be doing:

!ssh

works just as well - and across most shells.

It's nice when you do this:

vi foo
sh foo
!vi
!sh
(ad nauseam...)



[ Reply to This | # ]
run last command containing ...
Authored by: hayne on Dec 01, '04 06:57:33PM

If you want to re-run a command but don't know what it started with, or don't want the last version of that command, you can use !?

E.g. run the following commands:
ls /System
ls /Users

Now run the following:

!?Sys

and it will redo the first of those two 'ls' commands.



[ Reply to This | # ]