Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Wildcard history search



I'm just wondering if zsh has a tcsh feature that I find very
convenient. It's the ability to search the history list using
wildcards. For example, I have issued the following commands:

[107] echo brown is the fox
brown is the fox
[108] echo the fox is brown
the fox is brown

In order to match [107] without going through [108], I only need to type:

[109] *x<Meta-P>

The "*x" will match the command containing the terminal word "fox"
[107] and not [108] which contains the word "fox" in the middle. To
explicitly match [108], I type "*n<Meta-P>", that is *{brow}n

Fancier combinations can exist like "??ho*<Meta-P>" which will match
{ec}ho{*} or "*{brown,fox}<Meta-P>" to math all commands the end with
either "brown" or "fox".



Messages sorted by: Reverse Date, Date, Thread, Author