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

Linux Users

lemmy.ml

message-square
75
link
fedilink
955

Linux Users

lemmy.ml

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

    Ctrl R

  • iamdefinitelyoverthirteen@lemmy.world
    link
    fedilink
    arrow-up
    35
    ·
    5 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
      9
      ·
      5 days ago

      Been there, done that.

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

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

  • dreadbeef@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    3
    ·
    3 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.

  • mvirts@lemmy.world
    link
    fedilink
    arrow-up
    18
    ·
    5 days ago

    ^r

    • veni_vedi_veni@lemmy.world
      link
      fedilink
      arrow-up
      11
      ·
      5 days ago

      and whenever you forget to sudo: sudo !!

      • Gumus@lemmy.world
        link
        fedilink
        arrow-up
        7
        ·
        5 days ago

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

    • bandwidthcrisis@lemmy.world
      link
      fedilink
      arrow-up
      8
      ·
      5 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
        7
        ·
        5 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
          ·
          5 days ago

          It’s basically emacs incremental search.

  • Mad_Punda@feddit.org
    link
    fedilink
    arrow-up
    12
    ·
    5 days ago

    I’ve probably done that for ls

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

    O(n) access, very efficient.

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

  • Hammerheart@programming.dev
    link
    fedilink
    arrow-up
    7
    ·
    5 days ago

    cat ~/.bash_history | grep

    • echindod@programming.dev
      link
      fedilink
      arrow-up
      11
      ·
      5 days ago

      Useless use of cat?

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

        Yes, it was meant to be a self deprecating admission that I have used this unnecessarily verbose command.

        • echindod@programming.dev
          link
          fedilink
          arrow-up
          2
          ·
          3 days ago

          Ah. Well. I can not be blameless on this. I also probably use cat unnecessarily still. But less so with grep these days. I’m getting better… I swear!

      • disobey2623@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        2
        ·
        4 days ago

        You saying I can just skip cat in that command and it works?

        • x00z@lemmy.world
          link
          fedilink
          English
          arrow-up
          7
          ·
          4 days ago

          history | grep 'cat'

          • ulterno@programming.dev
            link
            fedilink
            English
            arrow-up
            0
            ·
            4 days ago

            My output was empty for that command.

            Guess why?
            Because history only gives the last few lines in my system.

        • neox_@sh.itjust.works
          link
          fedilink
          Français
          arrow-up
          4
          ·
          4 days ago
          grep ~/.bash_history
          
          • disobey2623@lemmy.dbzer0.com
            link
            fedilink
            arrow-up
            4
            ·
            4 days ago

            How did I not know this. Thank you!

            • oozynozh@sh.itjust.works
              link
              fedilink
              arrow-up
              2
              ·
              4 days ago

              it’s grep STRING FILE to be precise

              or awk '/STRING/′ FILE if you prefer that for some reason

  • Yggstyle@lemmy.world
    link
    fedilink
    arrow-up
    10
    ·
    5 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
      ·
      5 days ago

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

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

    also when they see this post

  • Deacon@lemmy.world
    link
    fedilink
    arrow-up
    6
    ·
    5 days ago

    Wow this is really validating for me to read. I’ve been using Linux for a few years but I’m definitely not a computer expert and am intimidated by the command line.

    I’ve always felt like googling every command and arrowing up to find an old entry rather than just googling it again marked me as a fake Linux user, not a real one.

    • cm0002@lemmy.worldOP
      link
      fedilink
      arrow-up
      6
      ·
      5 days ago

      Lol don’t feel bad, I can do advanced crazy shit with Linux like pivoting the running OS into RAM so I can unmount the boot drive to do whatever without ever rebooting

      But I still [Web Search] commands a shit ton of the time LMAO

    • zarkanian@sh.itjust.works
      link
      fedilink
      arrow-up
      3
      ·
      5 days ago

      You can use Ctrl-R and Ctrl-Shift-R to search through your history instead of having to push up a bajillion times.

    • Cevilia (she/they/…)@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      1
      ·
      5 days ago

      Nah, fuck the gatekeepers, you’re all good.

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

    Too many people still use Bash.

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

      I like zsh on mac because pretty colors

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

      Too many distributions still ship with Bash.

      • rtxn@lemmy.world
        link
        fedilink
        arrow-up
        10
        ·
        5 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
        5 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
          8
          ·
          5 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
            ·
            5 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
          2
          ·
          5 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
            4
            ·
            5 days ago

            Internet Explorer shell expansion always trips me up.

        • Croquette@sh.itjust.works
          link
          fedilink
          arrow-up
          1
          ·
          5 days ago

          What shell do you recommend?

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

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

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

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

              • merc@sh.itjust.works
                link
                fedilink
                arrow-up
                4
                ·
                5 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.

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

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

  • freewheel@sh.itjust.works
    link
    fedilink
    arrow-up
    6
    ·
    5 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
      5
      ·
      5 days ago

      bash supports this feature too btw

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

        Added to my mental toolbox, thanks!

  • MashedTech@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    4 days ago

    I just use mcfly

    • xoggy@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      ·
      4 days ago

      Not sure I understand the point of mcfly. zsh and fish have this functionality built in, where pressing Up with a command partially typed will give auto-completions to that partial match.

      • MashedTech@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        3 days ago

        Yeah. I also use auto-completions for that. McFly does fuzzy finding and because it’s a different separate db, for me it works better across many sessions to find commands I had just recently used in another session.

  • Olgratin_Magmatoe@slrpnk.net
    link
    fedilink
    English
    arrow-up
    5
    ·
    edit-2
    5 days ago

    grep | history [search term]

    • Cevilia (she/they/…)@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      6
      ·
      5 days ago

      I think you meant history | grep [search term]

      (which was id 1003 for me btw)

      • Olgratin_Magmatoe@slrpnk.net
        link
        fedilink
        English
        arrow-up
        4
        ·
        5 days ago

        Oops, but yes that’s what I meant.

      • Gobo@lemmy.world
        link
        fedilink
        English
        arrow-up
        3
        ·
        5 days ago

        I do this all the time for that one long command I use monthly like for cert renewals.

      • A_norny_mousse@feddit.org
        link
        fedilink
        arrow-up
        3
        ·
        5 days ago

        alias hf='history|grep'

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.05K users / day
  • 3.4K users / week
  • 5.08K users / month
  • 10.2K users / 6 months
  • 1 local subscriber
  • 26.6K subscribers
  • 697 Posts
  • 4.6K Comments
  • Modlog
  • mods:
  • adr1an@programming.dev
  • Feyter@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.12
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org