programming.dev
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
alphacyberranger@sh.itjust.works to Programmer Humor@lemmy.mlEnglish · 1 年前

Up up and away we go

sh.itjust.works

message-square
36
link
fedilink
611

Up up and away we go

sh.itjust.works

alphacyberranger@sh.itjust.works to Programmer Humor@lemmy.mlEnglish · 1 年前
message-square
36
link
fedilink
alert-triangle
You must log in or register to comment.
  • SHOW_ME_YOUR_ASSHOLE@lemm.ee
    link
    fedilink
    arrow-up
    67
    ·
    1 年前

    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.

    • The Ramen Dutchman@ttrpg.network
      link
      fedilink
      arrow-up
      46
      ·
      1 年前

      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.

      • SHOW_ME_YOUR_ASSHOLE@lemm.ee
        link
        fedilink
        arrow-up
        9
        ·
        1 年前

        I will have to try that, I didn’t know that functionality existed, thanks!

        • vort3@lemmy.ml
          link
          fedilink
          arrow-up
          18
          ·
          1 年前

          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.

          • The Ramen Dutchman@ttrpg.network
            link
            fedilink
            arrow-up
            11
            ·
            1 年前

            Seems to work with [Ctrl]+[R] as well, though of course only with exact matches.

            • vort3@lemmy.ml
              link
              fedilink
              arrow-up
              4
              ·
              1 年前

              Sure, just as I said, this would work id you don’t need menu or fuzzy matching. But I would recommend using fzf history search anyway, it’s just too good.

              • The Ramen Dutchman@ttrpg.network
                link
                fedilink
                arrow-up
                3
                ·
                1 年前

                M-hm, I will try it as well! I was just letting people know the comment trick works regardless, cause that’s a nice tip as well!

            • tetris11@lemmy.ml
              link
              fedilink
              arrow-up
              2
              arrow-down
              1
              ·
              1 年前

              I’ve never understood prompt decoration like this.

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

              • The Ramen Dutchman@ttrpg.network
                link
                fedilink
                arrow-up
                2
                ·
                1 年前

                You meant the PS1 prompt?

                I just use one of the default oh-my-zsh themes that makes a clear line, so I can easily find the last line above a long output, for example when trying to read it back chronologically. With other PS1’s I often scroll over it without noticing.

              • ikidd@lemmy.world
                link
                fedilink
                English
                arrow-up
                2
                ·
                1 年前

                It makes my eyes bleed.

      • theherk@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        1 年前

        Also, atuin.sh.

        • LiveLM@lemmy.zip
          link
          fedilink
          English
          arrow-up
          3
          ·
          edit-2
          1 年前

          This looks super neat but I don’t really like the idea of sending my shell history to a third party, nor can I host my own server right now.
          Wish it was peer-to-peer like Syncthing

          • theherk@lemmy.world
            link
            fedilink
            arrow-up
            3
            ·
            1 年前

            I don’t either, but you don’t have to use that feature. I don’t. I just use with local db for that machine.

    • HereIAm@lemmy.world
      link
      fedilink
      arrow-up
      7
      ·
      1 年前

      And then you realise your dumb endless ls-ing has pushed the command off the history list

      • SHOW_ME_YOUR_ASSHOLE@lemm.ee
        link
        fedilink
        arrow-up
        4
        ·
        1 年前

        This is too accurate!

      • dubyakay@lemmy.ca
        link
        fedilink
        arrow-up
        2
        ·
        1 年前

        Can you change the history list size?

        • embed_me
          link
          fedilink
          arrow-up
          2
          ·
          edit-2
          1 年前

          Can you configure it to ignore ls and cd …

  • 🇦🇺𝕄𝕦𝕟𝕥𝕖𝕕𝕔𝕣𝕠𝕔𝕠𝕕𝕚𝕝𝕖@lemm.ee
    link
    fedilink
    English
    arrow-up
    15
    ·
    1 年前

    May i introduce u to atuin

    • slampisko@lemmy.world
      link
      fedilink
      arrow-up
      36
      arrow-down
      1
      ·
      1 年前

      I think you mean Crtl+R in bash

      • henfredemars@infosec.pub
        link
        fedilink
        English
        arrow-up
        2
        arrow-down
        1
        ·
        1 年前

        What does this sometimes appear not to work for me even though the command is clearly in the history?

        • Grappling7155@lemmy.ca
          link
          fedilink
          arrow-up
          12
          ·
          1 年前

          Try

          history | fzf
          

          https://github.com/junegunn/fzf

          • The Ramen Dutchman@ttrpg.network
            link
            fedilink
            arrow-up
            3
            ·
            1 年前

            Ooh that’s even cooler!

            Not MySQL, though, but nice for usage in a terminal!

    • justcallmelarry@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      13
      arrow-down
      1
      ·
      1 年前

      Nah thanks, up arrow hasnt failed me yet

    • xmunk@sh.itjust.works
      link
      fedilink
      arrow-up
      8
      ·
      1 年前

      I don’t believe in A’tuin. The world is obviously carried on the back of a badger.

      • MyNameIsRichard@lemmy.ml
        link
        fedilink
        arrow-up
        3
        ·
        1 年前

        But the turtle moves.

        • xmunk@sh.itjust.works
          link
          fedilink
          arrow-up
          3
          ·
          1 年前

          And the honey badger mauls. My planet could beat up your planet in a fight.

    • Tekhne@sh.itjust.works
      link
      fedilink
      arrow-up
      2
      ·
      1 年前

      Have you used fish? The built-in fuzzy matching works pretty well for me. Wondering if there’s any reason to add atuin in. Sync seems like a negative to me more than a positive.

      • 🇦🇺𝕄𝕦𝕟𝕥𝕖𝕕𝕔𝕣𝕠𝕔𝕠𝕕𝕚𝕝𝕖@lemm.ee
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 年前

        Yeah they are compatible. Sync can be disabled entirely or self hosted.

      • theherk@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        1 年前

        I use fish with atuin but without sync. It is nice because I can search commands for a given workspace. For example the commands within a given git repository.

  • 𝘋𝘪𝘳𝘬@lemmy.ml
    link
    fedilink
    arrow-up
    13
    ·
    1 年前

    *tap*
    no
    *tap*
    no
    *tap*
    no

    Okay, NOW it’s getting personal!

  • thr0w4w4y2@sh.itjust.works
    link
    fedilink
    arrow-up
    10
    ·
    1 年前

    me typing “sudo !!” instead of rewriting the shell command undoes this.

  • livingcoder
    link
    fedilink
    arrow-up
    4
    ·
    1 年前

    Who is writing SQL in the terminal?

    • ikidd@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      edit-2
      1 年前

      MariaDB CLI about once in a blue moon when I have to clear some table that’s gotten borked.

    • Razzazzika@lemm.ee
      link
      fedilink
      arrow-up
      1
      ·
      1 年前

      Was thinking the same thing… now, searching through all my SQL scripts for the past year to find the same logic I want to replicate in another script, well that’s different.

      • livingcoder
        link
        fedilink
        arrow-up
        1
        ·
        1 年前

        I save “template” SQL queries in a special directory so that I don’t have to google how to do specific things. It’s basically my own personal “examples” folder.

  • PeriodicallyPedantic@lemmy.ca
    link
    fedilink
    arrow-up
    3
    ·
    1 年前

    Me in the bash terminal

Programmer Humor@lemmy.ml

programmerhumor@lemmy.ml

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 17 users / day
  • 294 users / week
  • 1.66K users / month
  • 7.65K users / 6 months
  • 794 local subscribers
  • 38.4K subscribers
  • 1.89K Posts
  • 40.2K Comments
  • Modlog
  • mods:
  • AgreeableLandscape@lemmy.ml
  • cat_programmer@lemmy.ml
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org