If you have fzf installed, it is easy to integrate it with your bash history. In my .bashrc, I have:
<span style="font-style:italic;color:#969896;"># Introduce fzf-driven functionality as described here: https://wiki.archlinux.org/title/fzf.
</span><span style="color:#62a35c;">source</span><span style="color:#323232;"> /usr/share/fzf/key-bindings.bash
</span><span style="color:#62a35c;">source</span><span style="color:#323232;"> /usr/share/fzf/completion.bash
</span>
Also, you may be interested in zoxide, which keeps track of paths you have navigated to. Also from my .bashrc:
<span style="font-style:italic;color:#969896;"># Enable an autojump-like 'j' command. Use 'ji M' to select paths starting with M using fzf.
</span><span style="font-style:italic;color:#969896;"># This needs to always come last.
</span><span style="color:#62a35c;">eval </span><span style="color:#183691;">"$(</span><span style="color:#323232;">zoxide</span><span style="color:#183691;"> init</span><span style="color:#323232;"> --cmd</span><span style="color:#183691;"> j bash)"
</span>