• neidu3@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    7
    ·
    1 day ago

    I accidentally stumbled across Ctrl+r over a decade ago and I still don’t understand properly how it works. So I usually egrep -e someInsaneRegex ~/.bash_history

    • ∃∀λ@programming.dev
      link
      fedilink
      arrow-up
      3
      ·
      21 hours ago

      The part of the tech stack that handles all these command editing and navigation shortcuts is the readline library. Check out man readline. There’s an entire section on searching. readline is used for lots of other interpreters, too.

    • FishFace@piefed.social
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 day ago

      That is worth it for more complicated things like, “I want all commands that started with git and contained ‘foo’”

      • Prunebutt@slrpnk.net
        link
        fedilink
        arrow-up
        7
        ·
        edit-2
        1 day ago

        If you install a fuzzyfinder, like fzf, or skim, you get previews of the search query result and fuzzy search, which is really cool, too.