• Multiplexer@discuss.tchncs.de
        link
        fedilink
        arrow-up
        53
        ·
        edit-2
        1 day ago

        Lets you easily and interactively search your command history.
        Half the stuff I do is usually preceded by that, it’s really useful!

        • Jack@slrpnk.net
          link
          fedilink
          arrow-up
          99
          ·
          1 day ago

          Oh that is nice, I usually use ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

          • groet@feddit.org
            link
            fedilink
            arrow-up
            8
            arrow-down
            1
            ·
            1 day ago

            Yeah standard bash Ctrl+r is just so painful. I much rather use “history | grep searchtearm” than that awfull search. fzf is a whole other level. But nowadays I just use fish shell which IMO has even better search than fzf

        • ulterno@programming.dev
          link
          fedilink
          English
          arrow-up
          1
          arrow-down
          1
          ·
          22 hours ago

          I have been suggested alternative programs to install to work with Ctrl+r, which are supposed to work better, but I just end up using kwrite ~/.bash_history when Ctrl+r fails.

    • 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.

        • crater2150@feddit.org
          link
          fedilink
          arrow-up
          4
          ·
          16 hours ago

          I used fzf before atuin, and it works pretty similar, but atuin has a few additional features, as it tracks more information than the normal shell history. For example, you can also search only for commands that you executed in the current directory (great for stuff that is project specific). Or, if you use the history syncing feature, you can toggle search for commands you executed on either any or only the current machine.

    • alias_qr_rainmaker@lemmy.worldOP
      link
      fedilink
      arrow-up
      6
      arrow-down
      3
      ·
      edit-2
      1 day ago

      dude holy shit that is AWESOME! i had something similar, but it was a custom function.

      srch() { cat ~/.bash_history | grep -Ein “$@”}

      • Korthrun@lemmy.sdf.org
        link
        fedilink
        arrow-up
        3
        ·
        edit-2
        21 hours ago

        Did you know that grep can take the name of the file(s) you want it to search as the final arguments?

        For example: grep -Ein "$@" ~/.bash_history