• SHOW_ME_YOUR_ASSHOLE@lemm.ee
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    I’m not a programmer but I do this on the Linux command line all the time to find a command I used days or weeks ago. Or I’ll spend 20 minutes grepping history instead. All to avoid spending 5 minutes reading the manpage so I can remember which flags and arguments I used.

    • Fonzie!@ttrpg.network
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      Perhaps pressing [Ctrl]+[R] and typing to search makes it easier, I mean instead of grepping history?
      Most terminal emulators support it.

      You can also change your query (backspacing and typing again) and press [Ctrl]+[R] multiple times to go to older matches.

        • vort3@lemmy.ml
          link
          fedilink
          arrow-up
          0
          ·
          3 months ago

          Let me tell you that you can also add comments to your terminal commands and use them to search history using fzf. This might sound confusing but basically you do this:

          commandwithweirdoptions --option1=value1 --option2=value2 # run the usual thing

          Then you press Ctrl+R and type anything like «the thing», it uses fuzzy matching and finds the command in history, with a menu of other similar commands. Press enter, done.

          Note that you need to have fzf installed, otherwise there is no fuzzy matching and no menu of matching history results.

            • tetris11@lemmy.ml
              link
              fedilink
              arrow-up
              0
              ·
              3 months ago

              I’ve never understood prompt decoration like this.

              How.
              Does.
              Punctuating.
              Every.
              Statement.
              Increase.
              Readability.