Civilloquy
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002@lemmy.world to Programmer Humor@programming.dev · 26 days ago

Linux Users

lemmy.ml

message-square
93
fedilink
942

Linux Users

lemmy.ml

cm0002@lemmy.world to Programmer Humor@programming.dev · 26 days ago
message-square
93
fedilink
alert-triangle
You must log in or register to comment.
  • Auli@lemmy.ca
    link
    fedilink
    English
    arrow-up
    29
    ·
    26 days ago

    Ctrl R

  • iamdefinitelyoverthirteen@lemmy.world
    link
    fedilink
    arrow-up
    28
    ·
    26 days ago

    …until you press up one too many times and enter the same command but with a typo. Again.

    • AmidFuror@fedia.io
      link
      fedilink
      arrow-up
      6
      ·
      26 days ago

      Been there, done that.

    • layzerjeyt@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      3
      ·
      26 days ago

      There is an option you can set in .zshrc or .bashrc which only includes lines that exit 0 (success)

      • antimidas@sopuli.xyz
        link
        fedilink
        arrow-up
        3
        ·
        25 days ago

        Infuriatingly that would omit things like unit test runners from the history in case they don’t pass. As a developer I tend to re-run failed commands quite often, not sure how widely that applies, though.

        • ulterno@programming.dev
          link
          fedilink
          English
          arrow-up
          1
          ·
          25 days ago

          Oh, stuff like git diff and git log will end up being omitted pretty often.
          And a lot of times, the commands that end with piping into less

  • mvirts@lemmy.world
    link
    fedilink
    arrow-up
    22
    ·
    26 days ago

    ^r

    • veni_vedi_veni@lemmy.world
      link
      fedilink
      arrow-up
      10
      ·
      26 days ago

      and whenever you forget to sudo: sudo !!

      • Gumus@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        26 days ago

        You need this: https://github.com/nvbn/thefuck

    • bandwidthcrisis@lemmy.world
      link
      fedilink
      arrow-up
      6
      ·
      26 days ago

      Ctrl-r, l ctrl-r, ctrl-r, ctrl-r, ctrl-r, ctrl-r, ctrl-r, ctrl-r, ctrl-r. To get ls.

      • 2910000@lemmy.world
        link
        fedilink
        arrow-up
        5
        ·
        26 days ago

        No way! I didn’t know you could cycle through the results like that… awesome!

        • bandwidthcrisis@lemmy.world
          link
          fedilink
          arrow-up
          5
          ·
          26 days ago

          It’s basically emacs incremental search.

  • Mad_Punda@feddit.org
    link
    fedilink
    arrow-up
    15
    ·
    26 days ago

    I’ve probably done that for ls

  • killeronthecorner@lemmy.world
    link
    fedilink
    English
    arrow-up
    11
    ·
    26 days ago

    O(n) access, very efficient.

    No, I do not care to share the value of n

  • Yggstyle@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    26 days ago

    taptaptaptap… taptaptaptap… taptaptaptap taptaptaptap taptaptaptap

    … taptaptaptap

    … tap …

    … shit I was on a different user when I typed it.

    • iamdefinitelyoverthirteen@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      26 days ago

      Or “shit, I did in tmux last time so I could close the terminal window.”

  • freewheel@sh.itjust.works
    link
    fedilink
    arrow-up
    8
    ·
    26 days ago

    Substring completion on ZSH. Type in a small part of the command you want to find and then press up.

    • entwine@programming.dev
      link
      fedilink
      arrow-up
      7
      ·
      26 days ago

      bash supports this feature too btw

      • freewheel@sh.itjust.works
        link
        fedilink
        arrow-up
        2
        ·
        26 days ago

        Added to my mental toolbox, thanks!

  • UnfortunateShort@lemmy.world
    link
    fedilink
    English
    arrow-up
    8
    ·
    edit-2
    26 days ago

    fish has “directory-aware” autocomplete with inlay hints and a fantastic history command. I do not suffer from such weakness

  • ezekielmudd@reddthat.com
    link
    fedilink
    arrow-up
    8
    ·
    26 days ago

    Or, just type the command “history”, find the index number of the desired command, then type “! <index number>”, then <enter>.

    • Eager Eagle@lemmy.world
      link
      fedilink
      English
      arrow-up
      7
      ·
      26 days ago

      or Ctrl+R then search? I don’t know why people bother with history tbh.

      • merc@sh.itjust.works
        link
        fedilink
        arrow-up
        2
        ·
        26 days ago

        Because you can pipe history to grep.

        • snowe@programming.dev
          link
          fedilink
          arrow-up
          2
          ·
          26 days ago

          with fzf you get better grep with fuzzy search

    • irish_link@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      26 days ago

      Holy cow!! I didn’t know that. I have been using history > history.txt to find “that one command for that one thing” I only need once every other month or so. Thanks, now I can just do that.

  • flyingSock@feddit.org
    link
    fedilink
    arrow-up
    8
    ·
    26 days ago

    also when they see this post

  • salacious_coaster@infosec.pub
    link
    fedilink
    English
    arrow-up
    8
    ·
    26 days ago

    Relevant xkcd: https://xkcd.com/1168/

    • Hammerheart@programming.dev
      link
      fedilink
      arrow-up
      4
      ·
      26 days ago

      tar --help

  • ѕєχυαℓ ρσℓутσρє@lemmy.sdf.org
    link
    fedilink
    arrow-up
    6
    ·
    26 days ago

    In fish, you can enter part of the command, and then press up to search for it. It’s kinda awesome.

    • rozodru@piefed.social
      link
      fedilink
      English
      arrow-up
      4
      ·
      26 days ago

      yeah I ONLY just recently switched to fish after using zsh and oh my zsh for so long - pretty much since first starting linux cause I once saw someone using it on unixporn and I thought “that’s cool”

      when I switched to NixOS zsh with all the plugins was a total slog. switched to fish and it just HAS everything that zsh/oh my zsh and the various plugins had but baked in.

      so yeah in Fish it’s just starting to type something and hoping it’s still in the history.

  • merc@sh.itjust.works
    link
    fedilink
    arrow-up
    5
    ·
    26 days ago

    Too many people still use Bash.

    • humorlessrepost@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      26 days ago

      I like zsh on mac because pretty colors

    • Leonardo_da_Vinci@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      26 days ago

      Too many distributions still ship with Bash.

      • rtxn@lemmy.world
        link
        fedilink
        arrow-up
        10
        ·
        26 days ago

        In the real world, the only thing better than perfect is standardized.

      • merc@sh.itjust.works
        link
        fedilink
        arrow-up
        3
        ·
        edit-2
        26 days ago

        Yeah, true. But, it’s easy to change.

        Bash is the Internet Explorer of shells. It’s great for installing a more useful shell.

        • layzerjeyt@lemmy.dbzer0.com
          link
          fedilink
          arrow-up
          7
          arrow-down
          1
          ·
          26 days ago

          That’s super unkind and incorrect. IE was a trash software that was widely available because MS was trying to extend their monopoly into new areas.

          Even if it’s not your taste, bash is a mature, stable FLOSS package with wide community support. The reason it is so common is due to it’s positive attributes, not because there is a plot to make it the only choice available to you.

          • calcopiritus@lemmy.world
            link
            fedilink
            arrow-up
            3
            ·
            26 days ago

            Bash might be better than IE. But I think we can agree that it is no longer a good shell.

            Its syntax is awful, and lacks many features that other shells have.

            It is only so widely used because it is a de facto standard. If bash was created today, barely no one would us it.

        • pivot_root@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          26 days ago

          That’s not true. Internet Explorer was fucking useless for scripting together things, unlike bash.

          • layzerjeyt@lemmy.dbzer0.com
            link
            fedilink
            arrow-up
            3
            ·
            26 days ago

            Internet Explorer shell expansion always trips me up.

        • Croquette@sh.itjust.works
          link
          fedilink
          arrow-up
          0
          ·
          26 days ago

          What shell do you recommend?

          • merc@sh.itjust.works
            link
            fedilink
            arrow-up
            3
            ·
            26 days ago

            I like zsh, but some people say great things about fish.

            • Auli@lemmy.ca
              link
              fedilink
              English
              arrow-up
              2
              ·
              26 days ago

              My problem with those is bash is always there and just works.

              • merc@sh.itjust.works
                link
                fedilink
                arrow-up
                3
                arrow-down
                1
                ·
                26 days ago

                Yes, just like Internet Explorer.

                It’s good to know how to do things in bash, since you’re going to encounter it pretty often. But, that doesn’t mean you shouldn’t customize your shell on the machine(s) you use most often. Why stick with the default when there are better options? You’re just hobbling yourself.

  • dreadbeef@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    4
    ·
    24 days ago

    Fish once again undefeated. If I want to find that weird image magick command I used earlier with foo.png in it I just type foo.png, hit up and its usually the first one. It doesnt matter where foo.png occurs in the command, fish will find it.

  • alecsargent@lemmy.zip
    link
    fedilink
    arrow-up
    4
    ·
    26 days ago

    I always go past it because I go way to fast.

    • nous@programming.dev
      link
      fedilink
      English
      arrow-up
      2
      ·
      26 days ago

      I have more then once gave up on pressing up, hit ctrl + c to reset only to see the command I wanted briefly flash up as I am hitting ctrl + c

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.

  • 1.43K users / day
  • 2.67K users / week
  • 7.2K users / month
  • 15K users / 6 months
  • 1 local subscriber
  • 26.9K subscribers
  • 1.6K Posts
  • 40.1K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.5
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org