Hacker News new | ask | show | jobs
by zem 895 days ago
for work, there are a lot of commands with complex invocations that I do not use regularly enough to bother remembering all the flags. it is really useful to just grep through my full shell history to find all the times I ran that command and just copy/paste the relevant one.
3 comments

Yep, I do `history | grep "<whatever>"` all the time..

I should probably make it a function now that I think about it.

Most of the shells have built-in recursive search, why not just use that? `Ctrl + R` in bash / fish / zsh at least.
i usually want to just see all the options at once and pick the one i want, rather than searching through them one by one
i called my function `fh` for "full history"
I end up manually curating skeleton command lines in a text file - partly because I've never had functional full badh history
i shared my full-history script on here a while back and someone pointed me to atuin :) https://news.ycombinator.com/item?id=32477431
It may just be that I don't use the shell very much compared with other people, mostly for building and running local code