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

Better way to execute commands from history?



Hi,

I am in the habit of doing the following:

% fc -l -1000| grep -i cd | grep -i link | tail -1 | cut -d" " -f3

which gives me the number of the command that contains both "cd" and
"link" in it. I then manually type in

% !num

where num is the output of the first command. I know there is a C-R
command, but doing it as above makes it possible to search the entire
string in the history list for multiple items.

I'm sure there's a better way to do this.

Any help appreciated.



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