Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Clever approach, but one extra step for me.

I made a shell script "hg" which stands for "history | grep." So "hg .wine" brings up all commands in the bash command history buffer with the string .wine in them, say "1601 ls .wine" To run one of course you just enter ! and the number of the command. So like... !1601. Whole process is extremely ergonomic.

Although - if anyone wants to write a shell extension that always runs the command output in a separate panel and keeps the parent panel (or tab) to just the commands entered that would be cool too.



> I made a shell script "hg" which stands for "history | grep."

Not a Mercurial user, I take it? (hg is the standard command for Mercurial.)


You can search the history with ctrl-r and then type the search. To make it even better use fzf as well.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: