Crony's Dungeon
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002@lemmy.world to Programmer Humor@programming.dev · 7 days ago

Linux Users

lemmy.ml

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

Linux Users

lemmy.ml

cm0002@lemmy.world to Programmer Humor@programming.dev · 7 days ago
message-square
104
link
fedilink
  • cross-posted to:
  • programmerhumor@lemmy.ml
alert-triangle
You must log in or register to comment.
  • TabbsTheBat (they/them)@pawb.social
    link
    fedilink
    arrow-up
    73
    ·
    7 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
      33
      ·
      7 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
        4
        ·
        6 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 (they/them)@pawb.social
        link
        fedilink
        arrow-up
        2
        ·
        7 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
      20
      ·
      7 days ago

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

    • sbird@sopuli.xyz
      link
      fedilink
      English
      arrow-up
      2
      ·
      5 days ago

      Woah Ctrl R looks super cool, never knew that I could do that before…

  • Auli@lemmy.ca
    link
    fedilink
    English
    arrow-up
    35
    ·
    6 days ago

    Ctrl R

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

      holy fucking shit 🤌💪🤯❤️💯

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

      Been there, done that.

  • aeharding@vger.social
    link
    fedilink
    arrow-up
    28
    ·
    6 days ago

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

    • Derpgon@programming.dev
      link
      fedilink
      arrow-up
      21
      ·
      6 days ago

      CTRL+R for those unitiated

    • Everyday0764@lemmy.zip
      link
      fedilink
      arrow-up
      6
      ·
      6 days ago

      reverse-i-search + fzf = <3

    • ulterno@programming.dev
      link
      fedilink
      English
      arrow-up
      0
      ·
      6 days 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
        ·
        5 days 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
          ·
          5 days ago

          history is shell dependent.

  • mvirts@lemmy.world
    link
    fedilink
    arrow-up
    25
    ·
    7 days ago

    ^r

    • veni_vedi_veni@lemmy.world
      link
      fedilink
      arrow-up
      12
      ·
      6 days ago

      and whenever you forget to sudo: sudo !!

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

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

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

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

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

          It’s basically emacs incremental search.

  • Edgarallenpwn@midwest.social
    link
    fedilink
    English
    arrow-up
    6
    ·
    5 days ago

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

  • RedSnt 👓♂️🖥️@feddit.dk
    link
    fedilink
    arrow-up
    4
    ·
    5 days ago

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

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

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

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

      tar --help

    • drkt@scribe.disroot.org
      link
      fedilink
      arrow-up
      8
      ·
      6 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

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

        Extract a tarball with verbose output from the specified file.

        And learn how to use the ‘z’ option

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

        You don’t even need the hyphen!

        Mind = blown.

    • psud@aussie.zone
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      4 days ago

      tar -jcvf archive.tbz ~/stuff/*

      Of course I don’t know the bomb had bzip2 on it… I wonder if we can start with ls to see if there’s anything to tar or untar

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

      tar - h

      • IsoKiero@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        12
        ·
        edit-2
        6 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
          11
          ·
          6 days ago

          Damn.

          • titanicx@lemmy.zip
            link
            fedilink
            arrow-up
            7
            ·
            6 days ago

            Thanks, we all died.

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

              :)

  • killeronthecorner@lemmy.world
    link
    fedilink
    English
    arrow-up
    12
    ·
    7 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
    9
    arrow-down
    2
    ·
    6 days ago

    cat ~/.bash_history | grep

    • echindod@programming.dev
      link
      fedilink
      arrow-up
      16
      ·
      6 days ago

      Useless use of cat?

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

  • pcouy@lemmy.pierre-couy.fr
    link
    fedilink
    arrow-up
    7
    ·
    7 days ago

    https://github.com/atuinsh/atuin is a great tool to manage and search your shell history. I especially enjoy it being able to search commands based on the working directory I was in when I ran them.

    It also has more features (which I don’t use) to manage dotfiles and sync shell history across hosts/devices.

    • nameisnotimportant@sh.itjust.works
      link
      fedilink
      arrow-up
      1
      ·
      6 days ago

      I was going to talk about it too ! Even though I’m on fish (which helps a lot with history search) atuin really changed my habits and made my life easier !

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

      bash supports this feature too btw

      • freewheel@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        6 days ago

        Added to my mental toolbox, thanks!

  • baltakatei@sopuli.xyz
    link
    fedilink
    arrow-up
    6
    ·
    6 days ago

    $ history | grep 'gre[p]' | less -S

    • mbp@lemmy.sdf.org
      link
      fedilink
      English
      arrow-up
      3
      ·
      6 days ago

      Does fuck all when you can’t remember even a piece of the command lol

      • baltakatei@sopuli.xyz
        link
        fedilink
        arrow-up
        1
        ·
        5 days ago

        That’s when you start spamming Page Up/Down, Home, End, and / to search within less. Usually seeing various commands jogs my memory, especially when they are grep commands searching for one I use often enough to be useful but infrequently enough to not remember off the top of my head.

      • Auli@lemmy.ca
        link
        fedilink
        English
        arrow-up
        1
        ·
        6 days ago

        Then how well you know which command it is when scrolling. At that point it’s googleing how do I move a file or whatever your looking for.

    • FourThirteen@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      6 days ago

      This is the answer

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

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

    • titanicx@lemmy.zip
      link
      fedilink
      arrow-up
      1
      ·
      6 days ago

      I think that actually makes you a real Linux user…

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.42K users / day
  • 4.84K users / week
  • 7.69K users / month
  • 17.9K users / 6 months
  • 1 local subscriber
  • 26.6K subscribers
  • 1.62K Posts
  • 49.5K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org