Civilloquy
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
obnomus@lemmy.ml to linuxmemes@lemmy.worldEnglish · 3 months ago

Noice

lemmy.ml

message-square
77
fedilink
396

Noice

lemmy.ml

obnomus@lemmy.ml to linuxmemes@lemmy.worldEnglish · 3 months ago
message-square
77
fedilink
alert-triangle
You must log in or register to comment.
  • Caveman@lemmy.world
    link
    fedilink
    arrow-up
    119
    ·
    edit-2
    3 months ago

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

    • juipeltje@lemmy.world
      link
      fedilink
      arrow-up
      64
      ·
      3 months ago

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

      • Mountainaire@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        3 months ago

        … because I had no idea about this until now. Sweet!

    • devfuuu@lemmy.world
      link
      fedilink
      arrow-up
      23
      ·
      3 months ago

      Not all shells support that.

      I use fish btw.

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

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

        • eneff@discuss.tchncs.de
          link
          fedilink
          arrow-up
          5
          ·
          3 months ago

          … are you not aware of Alt+S?!

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

            Nope haha. Thanks for letting me know

        • BolshoyToster@sh.itjust.works
          link
          fedilink
          arrow-up
          2
          ·
          3 months ago

          Does your keyboard not have a home key?

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

            Didn’t know home key could do that lol.

        • devfuuu@lemmy.world
          link
          fedilink
          arrow-up
          2
          ·
          3 months 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.

    • Sarcasmo220@lemmy.ml
      link
      fedilink
      arrow-up
      15
      ·
      3 months ago

      I learned something new today!

    • adeoxymus@lemmy.world
      link
      fedilink
      arrow-up
      6
      ·
      3 months ago

      I completely forgot about this one!

    • lefixxx@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      edit-2
      3 months ago

      wish i could alias that

      alias ffs=“sudo !!”

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

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

        • TedZanzibar@feddit.uk
          link
          fedilink
          English
          arrow-up
          1
          ·
          3 months ago

          Just to confirm: I tried this, it works.

      • Caveman@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        3 months ago

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

        • lefixxx@lemmy.world
          link
          fedilink
          arrow-up
          2
          ·
          3 months ago

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

    • obnomus@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      2
      arrow-down
      3
      ·
      3 months ago

      Bruh

      • Nalivai@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        3 months ago

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

        • obnomus@lemmy.mlOP
          link
          fedilink
          English
          arrow-up
          1
          arrow-down
          1
          ·
          3 months ago

          Fish

          • Nalivai@lemmy.world
            link
            fedilink
            arrow-up
            2
            ·
            3 months ago

            Oof. Posix non-compliant stuff always gives me the ick.
            I highly recommend switching to zsh, it can do the same stuff and more, and it is actually a proper terminal. Switching scripts might be a bit complicated if you’re deep into it, but it’s worth it

            • obnomus@lemmy.mlOP
              link
              fedilink
              English
              arrow-up
              1
              arrow-down
              1
              ·
              3 months ago

              All I do in terminal is type, I don’t know scripting. But I heard a lot of things about zsh.

              • Nalivai@lemmy.world
                link
                fedilink
                arrow-up
                2
                ·
                3 months ago

                Oh-my-zsh is a good start then. It gives you a bunch of themes and presets and plugins so you can do whatever you want with your zsh

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

                  I’ll try thanks for the recommendation.

  • ikidd@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    60
    ·
    3 months ago

    alias fuck="sudo !!"

    • Nilz@sopuli.xyz
      link
      fedilink
      arrow-up
      28
      ·
      3 months ago

      Wait, you don’t have The Fuck installed?

      • Caveman@lemmy.world
        link
        fedilink
        arrow-up
        6
        ·
        3 months ago

        Waiting for it to be rewritten in rust

        • daeraxa@programming.dev
          link
          fedilink
          arrow-up
          3
          ·
          3 months ago

          Only worth installing if it is 🔥🔥🔥blazing⚡⚡⚡fast

  • insufferableninja@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    19
    ·
    3 months 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
      6
      ·
      3 months ago

      Yeah I remembered that after uploading the meme.

  • nibbler@discuss.tchncs.de
    link
    fedilink
    arrow-up
    13
    ·
    3 months ago

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

    • obnomus@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      3 months ago

      Lmao

  • GarboDog@lemmy.world
    link
    fedilink
    arrow-up
    13
    ·
    3 months ago

    Wait… YOU CAN DO THAT?!

    • obnomus@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      5
      ·
      3 months ago

      Forgot to mention but only in fish shell.

      • GarboDog@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        3 months ago

        Ah oki lol

        • Mountainaire@lemmy.world
          link
          fedilink
          arrow-up
          2
          ·
          edit-2
          3 months ago

          I figured it out, at least in Linux Mint:

          1. Install Keysharp (which includes installing Microsoft’s .NET 10 Runtime, but not SDK!)
          2. Put this in a .ks folder:

          !s::{ ; Press Alt+S to use sudo on the previous Terminal line
              KeyWait 's'
              If WinActive('ahk_exe gnome-terminal-server')
                  Send 'sudo {!}{!}{Enter}'
          }
          

          Set it as a Startup Program with the command keysharp "(filepath)/(filename).ks" and it’ll always be ready to go!

      • Mountainaire@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        3 months ago

        What is the “fish shell?” Anyway, I’m gonna see if I can actually get this to work in any terminal through an external program…

  • RedstoneValley@sh.itjust.works
    link
    fedilink
    arrow-up
    11
    ·
    3 months ago

    Or press Ctrl-S and take a nice walk outside

  • eco_game@discuss.tchncs.de
    link
    fedilink
    arrow-up
    6
    ·
    3 months ago

    On my Terminal that just makes it so I can’t type anymore, I feel like I’m doing something wrong…

    My solution to the problem is CTRL+U, type sudo, CTRL+Y.

    • insufferableninja@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      11
      ·
      3 months ago

      If you hit ctrl-s, ctrl-q will unfreeze

      • screaming in digital@lemmy.ml
        link
        fedilink
        English
        arrow-up
        2
        ·
        3 months ago

        x👏off👏… x👏on👏… x👏off👏, x👏on👏…flowcontrol.

      • eco_game@discuss.tchncs.de
        link
        fedilink
        arrow-up
        1
        ·
        3 months ago

        Interesting, why is that? Like what feature is that?

        • Ephera@lemmy.ml
          link
          fedilink
          arrow-up
          6
          ·
          edit-2
          3 months ago

          Same reason there’s a ScrollLock key on keyboards. Didn’t always have scrollbars and if the application prints more than you can read, you want to pause that…

        • neclimdul@lemmy.world
          link
          fedilink
          arrow-up
          5
          ·
          3 months ago

          Short answer, terminals are built on the same technology as physical terminals from the 60s and 70s when controlling the flow of data from the server was a more useful feature.

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

          It’s part of the terminal emulator flow control

    • dracc@discuss.tchncs.de
      link
      fedilink
      arrow-up
      6
      ·
      3 months ago

      Ctrl + S freezes your shell yes. But Alt + S?

      • eco_game@discuss.tchncs.de
        link
        fedilink
        arrow-up
        3
        ·
        3 months ago

        Ah indeed, ALT+S does nothing. I must have pressed both before realizing it was frozen.

  • wpb@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    3 months ago

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

    • obnomus@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      3 months ago

  • TrickDacy@lemmy.world
    link
    fedilink
    arrow-up
    5
    arrow-down
    1
    ·
    edit-2
    3 months ago

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

    • yeehaw@lemmy.ca
      link
      fedilink
      arrow-up
      9
      ·
      3 months 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
        6
        arrow-down
        1
        ·
        3 months 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
          ·
          edit-2
          3 months 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
          ·
          3 months ago

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

    • obnomus@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      1
      arrow-down
      1
      ·
      3 months ago

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

  • jenesaisquoi@feddit.org
    link
    fedilink
    English
    arrow-up
    4
    ·
    3 months ago

    lol no vi mode

    • obnomus@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      3 months ago

      Vi mode?

      • jenesaisquoi@feddit.org
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 months 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.

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

    You can do that??

    I always did sudo !!

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

      Well its only for fish shell.

      • thedormantotaku@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        3 months ago

        I am using fish shell and just tried it. Thanks man. Such a convenient feature NGL

        • obnomus@lemmy.mlOP
          link
          fedilink
          English
          arrow-up
          1
          arrow-down
          1
          ·
          3 months ago

          No problem.

      • x0x7@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        3 months ago

        But in almost any shell there is also ctrl+a sudo. ctrl+s requires you haven’t sent it yet.

        Or also up ctrl+a sudo. It’s only one more key press than sudo !!, and unlocks ctrl-a. More useful to teach noobs IMO. Teach a skill instead of a quirk.

  • muhyb@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    3 months ago

    Is this a shell thing or a terminal thing? It doesn’t work for me on foot.

    • Ephera@lemmy.ml
      link
      fedilink
      arrow-up
      5
      ·
      3 months ago

      @Dionysus@leminal.space found out that it’s a feature in fish shell, which I can confirm.

      • muhyb@programming.dev
        link
        fedilink
        arrow-up
        3
        ·
        3 months ago

        Thanks. I think I should check out fish soon, I keep seeing it a lot lately and it seems to be made for lazy people like me. :)

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

          Fish has a bunch or weirdness if you’re used to other shells for things like substitution, and shortcuts like $_ don’t work afaik.

          • muhyb@programming.dev
            link
            fedilink
            arrow-up
            1
            ·
            3 months ago

            Huh, I checked and noticed that fish is non-POSIX. I guess I’ll just stick to zsh but I still want to check fish to see what’s all this about.

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

              Yeah, I tried it for a bit. It gives you coloured autocompletes for things in your history but you accept them with right-arrow rather than tab as well, which is a weird choice, and ctrl-r is still faster. It’s very much a day-to-day user’s experience rather than a scripting shell, I think people stick with others in their shebangs.

    • obnomus@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      3 months ago

      Ig its for fish shell

    • BCsven@lemmy.ca
      link
      fedilink
      arrow-up
      1
      ·
      3 months ago

      Not sure, I assumed universal because you use it with your history. Type history, see the number next to the command, do a !nnn and it will run that command from history

      • muhyb@programming.dev
        link
        fedilink
        arrow-up
        3
        ·
        3 months ago

        Oh, !! definitely works. I meant Alt+S shortcut.

        • BCsven@lemmy.ca
          link
          fedilink
          arrow-up
          3
          ·
          3 months ago

          Oh, LOL

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

    deleted by creator

  • Baŝto@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    1
    ·
    3 months ago

    Why do you not press the up arrow + Pos1?

    • obnomus@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      1
      arrow-down
      1
      ·
      3 months ago

      What is Pos1?

      • Baŝto@discuss.tchncs.de
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        3 months ago

        home key

  • prenatal_confusion@feddit.org
    link
    fedilink
    arrow-up
    1
    ·
    3 months ago

    Fuckit should be able to catch that

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 of any kind will not be tolerated. This is an LGBTQ+-friendly community – if that is a problem for you, you should leave.
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.

  • 1.34K users / day
  • 2.91K users / week
  • 4.78K users / month
  • 11.6K users / 6 months
  • 1 local subscriber
  • 32.6K subscribers
  • 1.95K Posts
  • 77.2K Comments
  • Modlog
  • mods:
  • Kevin@lemmy.world
  • zephyr@lemmy.world
  • Err(()).unwrap()@lemmy.world
  • BE: 0.19.5
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org