The Bard's Lemmy
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002@lemmy.world to Programmer Humor@programming.dev · 4 months ago

Linux Users

lemmy.ml

message-square
82
link
fedilink
904

Linux Users

lemmy.ml

cm0002@lemmy.world to Programmer Humor@programming.dev · 4 months ago
message-square
82
link
fedilink
alert-triangle
You must log in or # to comment.
  • lmmarsano@lemmynsfw.com
    link
    fedilink
    English
    arrow-up
    45
    ·
    4 months ago

    meme: bitches dont know bout ctrl-r
    or documentation.

    • Bash command line editing covers searching.
    • Readline library command line editing covers searching.
  • B_DL@lemmynsfw.com
    link
    fedilink
    English
    arrow-up
    37
    ·
    4 months ago

    I knew there was an

    ls
    

    In there somewhere

    • emb@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      4 months ago

      Now I don’t have to type that in again. Phew!

    • inktvip@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      3
      ·
      4 months ago

      ls … enter ↑ enter ↑ enter

      • ulterno@programming.dev
        link
        fedilink
        English
        arrow-up
        1
        ·
        4 months ago

        You may consider using watch ls

        • The Ramen Dutchman@ttrpg.network
          link
          fedilink
          English
          arrow-up
          1
          ·
          3 months ago

          I do like that, thanks a lot ulterno!

        • inktvip@lemmy.dbzer0.com
          link
          fedilink
          arrow-up
          1
          ·
          4 months ago

          I can’t even keep apart ls and cd it seems.

  • iamdefinitelyoverthirteen@lemmy.world
    link
    fedilink
    arrow-up
    33
    ·
    4 months ago

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

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

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

  • Auli@lemmy.ca
    link
    fedilink
    English
    arrow-up
    23
    ·
    4 months ago

    Ctrl R

  • mvirts@lemmy.world
    link
    fedilink
    arrow-up
    14
    ·
    4 months ago

    ^r

    • veni_vedi_veni@lemmy.world
      link
      fedilink
      arrow-up
      10
      ·
      4 months ago

      and whenever you forget to sudo: sudo !!

      • Gumus@lemmy.world
        link
        fedilink
        arrow-up
        6
        ·
        4 months ago

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

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

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

        • bandwidthcrisis@lemmy.world
          link
          fedilink
          arrow-up
          5
          ·
          4 months ago

          It’s basically emacs incremental search.

  • killeronthecorner@lemmy.world
    link
    fedilink
    English
    arrow-up
    12
    ·
    4 months ago

    O(n) access, very efficient.

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

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

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

  • salacious_coaster@infosec.pub
    link
    fedilink
    English
    arrow-up
    9
    ·
    4 months ago

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

    • Hammerheart@programming.dev
      link
      fedilink
      arrow-up
      6
      ·
      4 months ago

      tar --help

  • Hammerheart@programming.dev
    link
    fedilink
    arrow-up
    8
    arrow-down
    2
    ·
    4 months ago

    cat ~/.bash_history | grep

    • echindod@programming.dev
      link
      fedilink
      arrow-up
      11
      ·
      4 months ago

      Useless use of cat?

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

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

        • x00z@lemmy.world
          link
          fedilink
          English
          arrow-up
          8
          ·
          4 months ago

          history | grep 'cat'

          • ulterno@programming.dev
            link
            fedilink
            English
            arrow-up
            0
            ·
            4 months 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 months ago
          grep ~/.bash_history
          
          • disobey2623@lemmy.dbzer0.com
            link
            fedilink
            arrow-up
            4
            ·
            4 months ago

            How did I not know this. Thank you!

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

              it’s grep STRING FILE to be precise

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

      • Hammerheart@programming.dev
        link
        fedilink
        arrow-up
        2
        ·
        4 months 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
          ·
          4 months 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!

  • UnfortunateShort@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    4 months ago

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

  • Edgarallenpwn@midwest.social
    link
    fedilink
    English
    arrow-up
    6
    ·
    4 months ago

    I typed it once, I’m not typing it again

  • Deacon@lemmy.world
    link
    fedilink
    arrow-up
    6
    ·
    4 months 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
      arrow-down
      1
      ·
      4 months 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
      ·
      4 months 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
      ·
      4 months ago

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

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

      bash supports this feature too btw

      • freewheel@sh.itjust.works
        link
        fedilink
        arrow-up
        2
        ·
        4 months ago

        Added to my mental toolbox, thanks!

  • merc@sh.itjust.works
    link
    fedilink
    arrow-up
    6
    arrow-down
    1
    ·
    4 months ago

    Too many people still use Bash.

    • humorlessrepost@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      4 months ago

      I like zsh on mac because pretty colors

    • Leonardo_da_Vinci@lemmy.world
      link
      fedilink
      arrow-up
      1
      arrow-down
      1
      ·
      4 months ago

      Too many distributions still ship with Bash.

      • rtxn@lemmy.world
        link
        fedilink
        arrow-up
        10
        ·
        4 months ago

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

      • merc@sh.itjust.works
        link
        fedilink
        arrow-up
        3
        arrow-down
        1
        ·
        4 months 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
          9
          arrow-down
          1
          ·
          4 months 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
            arrow-down
            1
            ·
            4 months 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
          ·
          4 months 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
            ·
            4 months ago

            Internet Explorer shell expansion always trips me up.

        • Croquette@sh.itjust.works
          link
          fedilink
          arrow-up
          1
          ·
          4 months ago

          What shell do you recommend?

          • merc@sh.itjust.works
            link
            fedilink
            arrow-up
            4
            ·
            4 months ago

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

            • Auli@lemmy.ca
              link
              fedilink
              English
              arrow-up
              2
              ·
              4 months 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
                ·
                4 months 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.

  • Avicenna@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    4 months ago

    history | grep then !cmd no

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.

  • 300 users / day
  • 1.56K users / week
  • 3.77K users / month
  • 9.98K users / 6 months
  • 1 local subscriber
  • 28.3K subscribers
  • 1.46K Posts
  • 26.2K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.14
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org