Re:Show HN: Zev – Remember (or discover) terminal commands
by porridgeraisin on Saturday April 26, 2025 @04:45AM
(#43801942)
Fzf installs hooks automatically for ctrl+r and a bunch of other stuff
Search for `fzf --bash`. Note that the version in the ubuntu repos is too old to have this feature (I think)
You can build your own workflow by doing something like:
1. Turn on your shell’s feature to record command history.
2. Look into its feature set to control things such as how many entries it remembers, whether it remembers duplicate entries, and whether it timestamps each entry. (Don’t forget to restart each instance of your shell, if needed, for changes to take effect.)
3. Install a tool such as fzf that allows interactive filtering of arbitrary text. (On Mac, it’s as easy as `brew install fzf`.)
4. Write the necessary shell script(s) / functions / aliases to do things like:
+ invoke the fuzzy-finder on the shell’s history file or a modified version of that file (for example, a modified version that excludes bash’s timestamp lines, or that joins them - perhaps in a human-readable format - with the command it timestamps)
+ process the output of the fuzzy-finder tool (for example, to copy the command to the clipboard, paste it into the shell, or execute it immediately - which will necessitate things like removing any timestamp added in the previous step.)
Step 4 can be easy as something approximating (I’m on mobile right now):