schlunker
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
alphacyberranger@sh.itjust.works to Programmer Humor@programming.devEnglish · 11 个月前

Up up and away we go

sh.itjust.works

message-square
34
fedilink
383

Up up and away we go

sh.itjust.works

alphacyberranger@sh.itjust.works to Programmer Humor@programming.devEnglish · 11 个月前
message-square
34
fedilink
alert-triangle
You must log in or register to comment.
  • superkret@feddit.org
    link
    fedilink
    arrow-up
    52
    ·
    11 个月前

    • Fillicia@sh.itjust.works
      link
      fedilink
      arrow-up
      36
      ·
      11 个月前

      I really like this comic. Just in case someone didn’t know in Linux you can:

      -Ctrl + r to search previous commands

      Or

      -type history and precede the command number by an exclamation (!) to repeat the command (I.e. “!13”)

      • Aurenkin@sh.itjust.works
        link
        fedilink
        arrow-up
        21
        ·
        edit-2
        11 个月前

        Or just !! for the last command. Particularly helpful if you forgot to prefix it with sudo you can run sudo !!

        • Redderthanmisty@lemmygrad.ml
          link
          fedilink
          arrow-up
          2
          ·
          11 个月前

          Learn something new everyday

      • vvv@programming.dev
        link
        fedilink
        arrow-up
        8
        ·
        11 个月前

        I highly recommend installing fzf, and its shell integration. Makes your Ctrl + r magnitudes more pleasant to use!

      • BlackPenguins@lemmy.world
        link
        fedilink
        arrow-up
        7
        ·
        11 个月前

        What. Da fuck. This always existed?!

        • Trashboat@lemmy.blahaj.zone
          link
          fedilink
          arrow-up
          8
          ·
          11 个月前

          It’s probably from within the last 30 years or so

          • BlackPenguins@lemmy.world
            link
            fedilink
            arrow-up
            6
            ·
            11 个月前

            Oh good as long as it’s only a recent update.

      • Tetsuo@jlai.lu
        link
        fedilink
        arrow-up
        6
        ·
        11 个月前

        Also if you put “sensitive” information in your history by mistake you can use “history -d <line#>” to remove it.

        Unfortunately I had to use this command too many times.

      • zarkanian@sh.itjust.works
        link
        fedilink
        arrow-up
        5
        ·
        11 个月前

        Fish shell does this automatically. It’s one of the reasons I love it. You can auto-complete based on your command history.

        • Fillicia@sh.itjust.works
          link
          fedilink
          arrow-up
          4
          ·
          11 个月前

          I’m personlly a zsh+oh-my-zsh person which has the same type of auto complete option.

          My only regret is that something broke the thefuck plugin on my pc and now swearing at my screen doesn’t fix my mistakes.

      • oxomoxo@lemmy.world
        link
        fedilink
        arrow-up
        5
        arrow-down
        1
        ·
        11 个月前

        This works in Powershell as well, even on Windows…

      • fmstrat@lemmy.nowsci.com
        link
        fedilink
        English
        arrow-up
        4
        ·
        11 个月前

        Or control R, start typing a bit, control r again.

      • DefederateLemmyMl@feddit.nl
        link
        fedilink
        English
        arrow-up
        1
        ·
        11 个月前

        Ctrl + r to search previous commands

        That’s a readline thing by the way, so it doesn’t just work in bash but also works with other cli applications that are compiled with readline support, for example virsh, psql, fdisk, …

  • dejected_warp_core@lemmy.world
    link
    fedilink
    arrow-up
    9
    ·
    11 个月前

    There is an advantage to this approach though: fewer errors. You’re plucking a known working command from a list instead of manually typing a (possibly) broken version of it. Worse yet is when it’s a command where typematic mistakes cause unintended side effects like data loss. So, mashing up 100 times can be pretty smart, especially if you’re not a great typist.

    • benjaminV@piaille.fr
      link
      fedilink
      arrow-up
      7
      ·
      11 个月前

      @dejected_warp_core That is true if you assume your history contains only working commands…

      • dejected_warp_core@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        11 个月前

        Oh no, I have to press up 200+ times if we’re counting all the detritus and failure in my command history.

  • xmunk@sh.itjust.works
    link
    fedilink
    arrow-up
    7
    ·
    11 个月前

    Sorry, do you not keep sql scratch files around?

    If deving on the cli name and save to separate files your reusable queries…

  • Aurenkin@sh.itjust.works
    link
    fedilink
    arrow-up
    5
    ·
    11 个月前

    I’ve been using Atuin on my work computer and found it to be pretty good if you want something a bit fancier than Ctrl + R

  • Varyk@sh.itjust.works
    link
    fedilink
    arrow-up
    4
    ·
    11 个月前

    I definitely do this with terminal commands, because I’m not hunting for whatever the specific command line to animate my gif wallpaper is.

    • magic_lobster_party@fedia.io
      link
      fedilink
      arrow-up
      10
      ·
      11 个月前

      Ctrl + R is a life changer.

      • Varyk@sh.itjust.works
        link
        fedilink
        arrow-up
        10
        ·
        edit-2
        11 个月前

        HOLY SHIT.

        hahahaha, thank you. oh my gosh.

        This is the most significant terminal hotkey I’ve learned in months.

        ♪⁠┌⁠|⁠∵⁠|⁠┘⁠♪

        • dejected_warp_core@lemmy.world
          link
          fedilink
          arrow-up
          3
          ·
          11 个月前

          Upvoted for the dancing and singing emoticon. Nice art.

          • Varyk@sh.itjust.works
            link
            fedilink
            arrow-up
            5
            ·
            edit-2
            11 个月前

            Thanks, someone told me how to acess the old-school emotiocns recently and i like them.

            I Like THEM!

            (⁠ノ⁠°⁠_⁠o⁠)⁠ノ⁠⌒⁠┫⁠ ⁠┻⁠ ⁠┣⁠ ⁠┳

    • fuzzy_feeling@programming.dev
      link
      fedilink
      arrow-up
      2
      ·
      11 个月前

      been there, done that.

      then i heard about cli snippet manager. now i use qownnotes snippet manager qc. or you might try pet.

      • Varyk@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        11 个月前

        did you know about the ctrl+r command so you can search logged commands by keyword!

        magic lobster party told me about it and it’s amazing!

        I had no idea that was a function until now.

  • Billygoat@catata.fish
    link
    fedilink
    English
    arrow-up
    4
    ·
    11 个月前

    Can’t find the info atm but if you setup inputrc to use vim controls you can use the vim search in psql.

  • recursive_recursion [they/them]@programming.dev
    link
    fedilink
    English
    arrow-up
    4
    ·
    11 个月前

    So…Emacs huh

  • Fedegenerate@lemmynsfw.com
    link
    fedilink
    English
    arrow-up
    4
    ·
    11 个月前

    Me looking for apt update && apt upgrade -y

  • hex@programming.dev
    link
    fedilink
    arrow-up
    3
    ·
    11 个月前

    At work, was recently working on a script that alters the repo significantly. Every time I tested the script, I used the up arrow to get the git clean and git checkout HEAD -- files commands to reset the repo. I must’ve used those 100+ times.

  • Boomkop3@reddthat.com
    link
    fedilink
    arrow-up
    3
    ·
    11 个月前

    I do that sometimes, lazy as I can be

  • ExtraMedicated@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    11 个月前

    I open the text file where my powershell history is stored when the command I want isn’t recent enough.

  • (des)mosthenes@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    11 个月前

    oh the days before fzf

  • Samsy@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    11 个月前

    That’s when I realise I need more coffee.

Programmer Humor@programming.dev

programmer_humor@programming.dev

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: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

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

  • 2.51K users / day
  • 4K users / week
  • 9.04K users / month
  • 20K users / 6 months
  • 1 local subscriber
  • 24.8K subscribers
  • 1.55K Posts
  • 57K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.5
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org