sgfault
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
obnomus@lemmy.ml to linuxmemes@lemmy.worldEnglish · 2 days ago

Noice

lemmy.ml

message-square
94
link
fedilink
433

Noice

lemmy.ml

obnomus@lemmy.ml to linuxmemes@lemmy.worldEnglish · 2 days ago
message-square
94
link
fedilink
alert-triangle
You must log in or # to comment.
  • prenatal_confusion@feddit.org
    link
    fedilink
    arrow-up
    1
    ·
    2 hours ago

    Fuckit should be able to catch that

  • GarboDog@lemmy.world
    link
    fedilink
    arrow-up
    12
    ·
    22 hours ago

    Wait… YOU CAN DO THAT?!

    • obnomus@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      4
      ·
      6 hours ago

      Forgot to mention but only in fish shell.

      • GarboDog@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        2 hours ago

        Ah oki lol

  • b161@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    9
    ·
    1 day ago

    sudo !!

    • obnomus@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      6 hours ago

      For some reason I get this

      • wpb@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        5 hours ago

        Use zsh

  • printf("%s", name);@piefed.blahaj.zone
    link
    fedilink
    English
    arrow-up
    135
    ·
    2 days ago

    MaNLkfuwl4LB6ck.jpg

    • a14o@feddit.org
      link
      fedilink
      arrow-up
      1
      ·
      4 minutes ago

      Start with ctrl+p, ctrl+a but yes

    • obnomus@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      4
      ·
      6 hours ago

      Ayo chill

    • Ephera@lemmy.ml
      link
      fedilink
      arrow-up
      31
      ·
      2 days ago

      Always amused me that sudo !! is actually more keypresses (at least on keyboards where typing ! requires holding Shift).

      • printf("%s", name);@piefed.blahaj.zone
        link
        fedilink
        English
        arrow-up
        58
        ·
        2 days ago

        You just blew my mind. sudo [space] [shift] !! [enter] (4+1+1+1+1+1) is one keypress longer than ↑ + home + sudo + space + enter (1+1+4+1+1). In your face, universe.

        • Logi@lemmy.world
          link
          fedilink
          arrow-up
          11
          ·
          1 day ago

          If you have an actual home key. If it’s ctrl+a or (IIRC, AFK) ctrl+← then we’re even.

          And if we track hand movements then pressing ! twice may be faster than moving to another key.

          But yeah, it’s not at all clear that sudo !! is faster like you’d expect it to be.

      • Axolotl@feddit.it
        link
        fedilink
        arrow-up
        17
        ·
        2 days ago

        But it’s faster since your hand move less and you can keep shift pressed

      • Nilz@sopuli.xyz
        link
        fedilink
        arrow-up
        11
        ·
        2 days ago

        I use zsh with the sudo plugin. Double tap esc and your current or last command will be prefixed with sudo.

        • printf("%s", name);@piefed.blahaj.zone
          link
          fedilink
          English
          arrow-up
          8
          ·
          2 days ago

          I don’t dabble in black magic. /j

          It’s actually pretty neat.

    • SkaveRat@discuss.tchncs.de
      link
      fedilink
      arrow-up
      15
      ·
      2 days ago

      Ctrl A is easier to reach than the home key

      • ClownStatue@piefed.social
        link
        fedilink
        English
        arrow-up
        3
        ·
        1 day ago

        Unless you’re in a default screen session (I always thought ^A was such a dumb default for screen to use).

        • AnUnusualRelic@lemmy.world
          link
          fedilink
          arrow-up
          3
          ·
          22 hours ago

          Screen must have been written by someone who wasn’t familiar with the shell. It’s the only logical explanation.

          • ClownStatue@piefed.social
            link
            fedilink
            English
            arrow-up
            1
            ·
            edit-2
            22 hours ago

            Maybe someone who only used csh? I can’t remember if ^a is a default in that shell. I thought it started with ksh or bash.

            ETA: just looked it up and I’m dumb. Comes from emacs (of course) and looks like it was introduced in bash. I guess I could claim ignorance, being a VI man, but I actually knew at some point that it came from emacs. I think I can count on 1 hand the number of times I’ve used emacs

  • nibbler@discuss.tchncs.de
    link
    fedilink
    arrow-up
    13
    ·
    1 day ago

    I used to have an alias ‘please’ for that.

    • obnomus@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      6 hours ago

      Lmao

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

    <Esc> k I sudo <Space> <Enter>

    • obnomus@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      6 hours ago

  • Caveman@lemmy.world
    link
    fedilink
    arrow-up
    141
    arrow-down
    1
    ·
    2 days ago

    You can also just do a sudo !! the !! is a shorthand for whatever you tried to run previously.

    • obnomus@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      2
      arrow-down
      1
      ·
      6 hours ago

      Bruh

      • Nalivai@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        44 minutes ago

        What shell are you using? In both bash and zsh, !! is a substitute for a previous command

    • lefixxx@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      24 hours ago

      wish i could alias that

      alias ffs=“sudo !!”

      • timbuck2themoon@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        4
        ·
        20 hours ago

        alias ffs='sudo $(history -p !!)'

        • TedZanzibar@feddit.uk
          link
          fedilink
          English
          arrow-up
          2
          ·
          18 hours ago

          Just to confirm: I tried this, it works.

      • Caveman@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        24 hours ago

        That doesn’t work? I would have thought it would work.

        • lefixxx@lemmy.world
          link
          fedilink
          arrow-up
          2
          ·
          24 hours ago

          !! Gets replaced by whatever was run before the alias command

    • juipeltje@lemmy.world
      link
      fedilink
      arrow-up
      76
      ·
      2 days ago

      Was about to say, why would you copy anything when using sudo !! lol

    • devfuuu@lemmy.world
      link
      fedilink
      arrow-up
      27
      ·
      2 days ago

      Not all shells support that.

      I use fish btw.

      • furry toaster@lemmy.blahaj.zone
        link
        fedilink
        English
        arrow-up
        17
        ·
        2 days ago

        I made my own !!

        • ArchAengelus@lemmy.dbzer0.com
          link
          fedilink
          arrow-up
          17
          ·
          2 days ago

          I know what you meant (I have one for fish as well), but I chucked because you looked very enthusiastic about it!

          The fish function for !! is super useful though

      • guymontag@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        1 day ago

        Holy shit I wish fish supported it. I just press up arrow then hold left arrow and manually type sudo. It fucking sucks

        • tekino@pawb.social
          link
          fedilink
          arrow-up
          2
          ·
          18 hours ago

          I’ve been using this plugin https://github.com/oh-my-fish/plugin-bang-bang fish also allows going through previous arguments with alt+up

          • guymontag@lemmy.ml
            link
            fedilink
            arrow-up
            1
            ·
            3 hours ago

            Epicc. I should install thjs

        • eneff@discuss.tchncs.de
          link
          fedilink
          arrow-up
          6
          ·
          1 day ago

          … are you not aware of Alt+S?!

          • guymontag@lemmy.ml
            link
            fedilink
            arrow-up
            1
            ·
            3 hours ago

            Nope haha. Thanks for letting me know

        • devfuuu@lemmy.world
          link
          fedilink
          arrow-up
          2
          ·
          21 hours ago

          I’ve used it for so many years that it’s not an issue anymore. I remember using !! a lot but it was literally just for sudo. Now i either write what I need and do up or write what I need and then press alt+s, which seems even more intuitive now.

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

          Does your keyboard not have a home key?

          • guymontag@lemmy.ml
            link
            fedilink
            arrow-up
            2
            ·
            3 hours ago

            Didn’t know home key could do that lol.

      • NannerBanner@literature.cafe
        link
        fedilink
        arrow-up
        7
        ·
        2 days ago

        I don’t even know what I use anymore. My distro seems to keep changing it when I reinstall.

        • unbuckled_easily933@lemmy.ml
          link
          fedilink
          English
          arrow-up
          9
          ·
          2 days ago
          echo $SHELL
          
          • NannerBanner@literature.cafe
            link
            fedilink
            arrow-up
            5
            ·
            1 day ago

            Lol, thanks. Now I know.

    • Sarcasmo220@lemmy.ml
      link
      fedilink
      arrow-up
      16
      ·
      2 days ago

      I learned something new today!

    • adeoxymus@lemmy.world
      link
      fedilink
      arrow-up
      6
      ·
      2 days ago

      I completely forgot about this one!

  • jenesaisquoi@feddit.org
    link
    fedilink
    English
    arrow-up
    4
    ·
    1 day ago

    lol no vi mode

    • obnomus@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      6 hours ago

      Vi mode?

      • jenesaisquoi@feddit.org
        link
        fedilink
        English
        arrow-up
        1
        ·
        5 hours ago

        GNU readline is the library that powers features like Ctrl-A, Ctrl-R and Alt+S. By default, it is in emacs mode - that is why it supports these shortcuts, they are the same as in emacs. It also supports vi style editing. You can switch to that by typing set -o vi in your shell. Then you can edit commands as if you were in vi, for example, instead of Ctrl-A you’d do Esc 0. Instead of Ctrl-R you’d do Esc /. If you are fluent in vi then this mode will be more useful.

        I used to work on really old Unix systems, sometimes over serial connections. They didn’t have bash (only ksh), and they didn’t understand arrow keys. Vi mode was the only way to edit commands that worked reliably.

  • ikidd@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    74
    ·
    2 days ago

    alias fuck="sudo !!"

    • Nilz@sopuli.xyz
      link
      fedilink
      arrow-up
      37
      ·
      2 days ago

      Wait, you don’t have The Fuck installed?

      • Caveman@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        24 hours ago

        Waiting for it to be rewritten in rust

  • Albbi@piefed.ca
    link
    fedilink
    English
    arrow-up
    17
    ·
    2 days ago

    I know alt +. inserts the last argument of previous commands. There must be a good list of alt commands somewhere because they’re pretty damn useful.

    • obnomus@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      6 hours ago

      Thanks to you, I just find out new keyboard shortcut

    • softwarist@programming.dev
      link
      fedilink
      English
      arrow-up
      8
      ·
      1 day ago

      The manual is a good place to start. It’s just GNU Readline under the hood.

  • insufferableninja@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    21
    ·
    2 days ago

    Top text should maybe say copying by, rather than copying then? Since sudo !! will automatically copy the previous command with sudo in front of it, so there’s no manual copying involved

    • obnomus@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      7
      ·
      2 days ago

      Yeah I remembered that after uploading the meme.

  • katy ✨@piefed.blahaj.zone
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 day ago

    oh my zsh plugin just let’s you press esc twice :3

    • obnomus@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      6 hours ago

      Ayo what, I didn’t know that but I use fish.

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

    deleted by creator

  • RedstoneValley@sh.itjust.works
    link
    fedilink
    arrow-up
    10
    ·
    2 days ago

    Or press Ctrl-S and take a nice walk outside

  • TrickDacy@lemmy.world
    link
    fedilink
    arrow-up
    7
    ·
    2 days ago

    Cannot find any reference online. What is this supposed to do? Not at a PC right now.

    • obnomus@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      6 hours ago

      It runs the previous command with sudo, also its only for fish shell.

    • yeehaw@lemmy.ca
      link
      fedilink
      arrow-up
      9
      ·
      2 days ago

      !! Just puts in your last typed command. So if you typed rm -rf /etc, you wouldn’t have permission. But if you typed in sudo !! Right after, then you’re really fucked.

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

        Ah I wasn’t clear – those, I knew. It’s alt+S I don’t know. I’m at my machine now and it doesn’t seem to do anything on Pop_OS.

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

          Seem to be a fish shell thing.

          I tested on my good ole trusty bash and got nothing so I went searching.

          EDIT: Clarification : alt+s seems to be a fish shell thing.

        • yeehaw@lemmy.ca
          link
          fedilink
          arrow-up
          3
          ·
          2 days ago

          Ya I haven’t tried alt s. Never heard of it before either.

      • softotteep@pawb.social
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 days ago

        But if you typed in sudo !! Right after, then you’re really fucked.

        Not if you don’t type your password.

        • ClownStatue@piefed.social
          link
          fedilink
          English
          arrow-up
          3
          ·
          1 day ago

          Adding to this, if you notice numbers next to your previous commands when you run history, you can do !<number> and it will rerun that command. Probably the second cool shell trick I learned back in the olden days or yore (mid-90s?) after ⬆️

          • moopet@sh.itjust.works
            link
            fedilink
            English
            arrow-up
            3
            ·
            24 hours ago

            ctrl-r is generally quicker

            • ClownStatue@piefed.social
              link
              fedilink
              English
              arrow-up
              1
              ·
              22 hours ago

              Learned that one embarrassingly much later.

        • yeehaw@lemmy.ca
          link
          fedilink
          arrow-up
          2
          ·
          1 day ago

          I assume if you are silly enough to type in rm -rf /etc, then you are silly enough to type in your password 😅

linuxmemes@lemmy.world

linuxmemes@lemmy.world

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: !linuxmemes@lemmy.world

Hint: :q!


Sister communities:
  • !tech_memes@lemmy.world
  • !memes@lemmy.world
  • !lemmyshitpost@lemmy.world
  • !risa@startrek.website

Community rules (click to expand)

1. Follow the site-wide rules
  • Instance-wide TOS: https://legal.lemmy.world/tos/
  • Lemmy code of conduct: https://join-lemmy.org/docs/code_of_conduct.html
2. Be civil
  • Understand the difference between a joke and an insult.
  • Do not harrass or attack users for any reason. This includes using blanket terms, like “every user of thing”.
  • Don’t get baited into back-and-forth insults. We are not animals.
  • Leave remarks of “peasantry” to the PCMR community. If you dislike an OS/service/application, attack the thing you dislike, not the individuals who use it. Some people may not have a choice.
  • Bigotry will not be tolerated.
3. Post Linux-related content
  • Including Unix and BSD.
  • Non-Linux content is acceptable as long as it makes a reference to Linux. For example, the poorly made mockery of sudo in Windows.
  • No porn, no politics, no trolling or ragebaiting.
  • Don’t come looking for advice, this is not the right community.
4. No recent reposts
  • Everybody uses Arch btw, can’t quit Vim, <loves/tolerates/hates> systemd, and wants to interject for a moment. You can stop now.
5. 🇬🇧 Language/язык/Sprache
  • This is primarily an English-speaking community. 🇬🇧🇦🇺🇺🇸
  • Comments written in other languages are allowed.
  • The substance of a post should be comprehensible for people who only speak English.
  • Titles and post bodies written in other languages will be allowed, but only as long as the above rule is observed.
6. (NEW!) Regarding public figures

We all have our opinions, and certain public figures can be divisive. Keep in mind that this is a community for memes and light-hearted fun, not for airing grievances or leveling accusations.

  • Keep discussions polite and free of disparagement.
  • We are never in possession of all of the facts. Defamatory comments will not be tolerated.
  • Discussions that get too heated will be locked and offending comments removed.

 

Please report posts and comments that break these rules!


Important: never execute code or follow advice that you don’t understand or can’t verify, especially here. The word of the day is credibility. This is a meme community – even the most helpful comments might just be shitposts that can damage your system. Be aware, be smart, don’t remove France.

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 401 users / day
  • 1.51K users / week
  • 6.77K users / month
  • 7.66K users / 6 months
  • 1 local subscriber
  • 31.5K subscribers
  • 395 Posts
  • 3.53K Comments
  • Modlog
  • mods:
  • zephyr@lemmy.world
  • rtxn@lemmy.world
  • BE: 0.19.18
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org