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

Linux Users

message-square
133
link
fedilink
  • cross-posted to:
  • programmerhumor@lemmy.ml
1.23K

Linux Users

cm0002@lemmy.world to Programmer Humor@programming.dev · 2 days ago
message-square
133
link
fedilink
  • cross-posted to:
  • programmerhumor@lemmy.ml
alert-triangle
You must log in or register to comment.
  • RedSnt 👓♂️🖥️@feddit.dk
    link
    fedilink
    arrow-up
    2
    ·
    6 hours ago

    I write part of the command then ctrl+r. Using FZF mind you. Such a great utility.

  • Edgarallenpwn@midwest.social
    link
    fedilink
    English
    arrow-up
    7
    ·
    13 hours ago

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

  • Auli@lemmy.ca
    link
    fedilink
    English
    arrow-up
    32
    ·
    1 day ago

    Ctrl R

    • sol6_vi@lemmy.makearmy.io
      link
      fedilink
      arrow-up
      1
      ·
      5 hours ago

      holy fucking shit 🤌💪🤯❤️💯

  • janAkali@lemmy.sdf.org
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    19 hours ago
    • zsh-autosuggestions
    • history | fzf
    • alias cat="bat --plain --theme=gruvbox-dark"
    • zarkanian@sh.itjust.works
      link
      fedilink
      arrow-up
      5
      ·
      edit-2
      12 hours ago

      Aliasing cat or any other ubiquitous shell utility to a replacement is a mistake. Garuda did this, and it was driving me crazy why cat was giving me errors. Turns out that they had aliased bat to cat, and since bat is a different program, it didn’t work in exactly the same way, and an update had introduced some unexpected behavior.

      Drop-in replacements are dumb. Just learn to use a different command.

      • janAkali@lemmy.sdf.org
        link
        fedilink
        arrow-up
        3
        ·
        edit-2
        8 hours ago

        I think it’s ok to add this in a personal .zshrc, not on a distro level:

        If it breaks something - I’d probably know why and can easily fix it by removing alias/calling cat directly.

        Also, scripts almost always use bash or sh in shebang, not zsh. So it only triggers if I type cat in terminal.

        • crater2150@feddit.org
          link
          fedilink
          arrow-up
          1
          ·
          2 hours ago

          Also, even zsh scripts don’t read your .zshrc by default.

  • remon@ani.social
    link
    fedilink
    arrow-up
    7
    arrow-down
    1
    ·
    23 hours ago

    You have to be a linux user to use the console now?

  • aeharding@vger.social
    link
    fedilink
    arrow-up
    32
    ·
    1 day ago

    The number of people who don’t reverse-I-search is too damn high

    • Derpgon@programming.dev
      link
      fedilink
      arrow-up
      25
      ·
      1 day ago

      CTRL+R for those unitiated

    • Everyday0764@lemmy.zip
      link
      fedilink
      arrow-up
      9
      ·
      1 day ago

      reverse-i-search + fzf = <3

    • ulterno@programming.dev
      link
      fedilink
      English
      arrow-up
      0
      ·
      18 hours ago

      It was quite a while before I realised that was possible.
      Then not long after starting to use it, that I got fed up and just started opening up the history file and searching in it.

      • dropcase@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        15 hours ago

        why not history | grep -i and the search term?

        even if there are several, you can use ! and the command’s line number to run it again

        • ulterno@programming.dev
          link
          fedilink
          English
          arrow-up
          1
          ·
          13 hours ago

          history is shell dependent.

  • MashedTech@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    1 day ago

    I just use mcfly

    • xoggy@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      ·
      18 hours 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
        ·
        2 hours 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.

  • TabbsTheBat@pawb.social
    link
    fedilink
    arrow-up
    87
    ·
    2 days ago

    I’ve been using ctrl + R more now :3… though I definitely used to ↑↑↑↑↑↑↑

    • I_Am_Jacks_____@sh.itjust.works
      link
      fedilink
      arrow-up
      38
      ·
      2 days ago

      check out fzf (install fzf and add (assuming bash) eval "$(fzf --bash)" to your .bashrc) Makes ctrl+r a superpower

      • aquovie@lemmy.cafe
        link
        fedilink
        English
        arrow-up
        5
        ·
        2 days ago

        It’s awesome until you want to put the cursor in a specific spot of a previous command.

        $ rm -f delete-me.txt
        ctrl-r "me", ctrl-b, ctrl-k
        $ rm -f delete
        

        But I still use fzf because while I used to do the above, fzf offered more advantage that made switching worth it.

      • TabbsTheBat@pawb.social
        link
        fedilink
        arrow-up
        3
        ·
        2 days ago

        I’ll try it if I don’t forget it by the next time I have access to my PC lol :3

    • tyler@programming.dev
      link
      fedilink
      arrow-up
      22
      ·
      2 days ago

      Ctrl + r with fzf and you’ll never go back.

  • iamdefinitelyoverthirteen@lemmy.world
    link
    fedilink
    arrow-up
    42
    ·
    2 days 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
      ·
      1 day 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
        5
        ·
        23 hours 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
          ·
          18 hours 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

    • AmidFuror@fedia.io
      link
      fedilink
      arrow-up
      10
      ·
      2 days ago

      Been there, done that.

  • mvirts@lemmy.world
    link
    fedilink
    arrow-up
    30
    ·
    2 days ago

    ^r

    • veni_vedi_veni@lemmy.world
      link
      fedilink
      arrow-up
      14
      ·
      2 days ago

      and whenever you forget to sudo: sudo !!

      • Gumus@lemmy.world
        link
        fedilink
        arrow-up
        8
        ·
        2 days ago

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

    • bandwidthcrisis@lemmy.world
      link
      fedilink
      arrow-up
      9
      ·
      2 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
        ·
        1 day ago

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

        • bandwidthcrisis@lemmy.world
          link
          fedilink
          arrow-up
          5
          ·
          1 day ago

          It’s basically emacs incremental search.

  • Hammerheart@programming.dev
    link
    fedilink
    arrow-up
    9
    arrow-down
    2
    ·
    1 day ago

    cat ~/.bash_history | grep

    • echindod@programming.dev
      link
      fedilink
      arrow-up
      16
      ·
      1 day ago

      Useless use of cat?

      • Hammerheart@programming.dev
        link
        fedilink
        arrow-up
        1
        ·
        3 hours ago

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

      • disobey2623@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        2
        ·
        1 day ago

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

        • x00z@lemmy.world
          link
          fedilink
          English
          arrow-up
          7
          ·
          23 hours ago

          history | grep 'cat'

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

            How did I not know this. Thank you!

            • oozynozh@sh.itjust.works
              link
              fedilink
              arrow-up
              2
              ·
              19 hours ago

              it’s grep STRING FILE to be precise

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

  • Mad_Punda@feddit.org
    link
    fedilink
    arrow-up
    17
    ·
    2 days ago

    I’ve probably done that for ls

  • salacious_coaster@infosec.pub
    link
    fedilink
    English
    arrow-up
    13
    ·
    2 days ago

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

    • Hammerheart@programming.dev
      link
      fedilink
      arrow-up
      7
      ·
      1 day ago

      tar --help

    • drkt@scribe.disroot.org
      link
      fedilink
      arrow-up
      9
      ·
      2 days ago

      tar -xvf <archive-name>

      but only because I had to look it up twice so now my brain has committed it to memory
      I don’t even know what it does

      • nutcase2690@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        4
        ·
        1 day ago

        i just use unar (unarchive) nowadays, since that works with all file formats iirc

      • jbrains@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        1 day ago

        You don’t even need the hyphen!

        Mind = blown.

      • bitchkat@lemmy.world
        link
        fedilink
        English
        arrow-up
        3
        arrow-down
        1
        ·
        2 days ago

        Extract a tarball with verbose output from the specified file.

        And learn how to use the ‘z’ option

    • ominous ocelot@leminal.space
      link
      fedilink
      arrow-up
      4
      ·
      2 days ago

      tar - h

      • IsoKiero@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        13
        ·
        edit-2
        2 days ago

        Unfortunately that’s not valid.

        $ tar -h
        tar: You must specify one of the '-Acdtrux', '--delete' or '--test-label' options
        Try 'tar --help' or 'tar --usage' for more information.
        

        From man-page:

        -h, --dereference follow symlinks; archive and dump the files they point to

        • ominous ocelot@leminal.space
          link
          fedilink
          arrow-up
          12
          ·
          2 days ago

          Damn.

          • titanicx@lemmy.zip
            link
            fedilink
            arrow-up
            8
            ·
            2 days ago

            Thanks, we all died.

            • ominous ocelot@leminal.space
              link
              fedilink
              arrow-up
              6
              ·
              2 days ago

              :)

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

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

  • killeronthecorner@lemmy.world
    link
    fedilink
    English
    arrow-up
    13
    ·
    2 days ago

    O(n) access, very efficient.

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

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.4K users / day
  • 5.29K users / week
  • 8.53K users / month
  • 16.8K users / 6 months
  • 1 local subscriber
  • 26.6K subscribers
  • 880 Posts
  • 16.5K Comments
  • Modlog
  • mods:
  • adr1an@programming.dev
  • Feyter@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org