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

Noice

lemmy.ml

message-square
110
link
fedilink
1

Noice

lemmy.ml

obnomus@lemmy.ml to linuxmemes@lemmy.worldEnglish · 2 months ago
message-square
110
link
fedilink
alert-triangle
You must log in or # to comment.
  • katy ✨@piefed.blahaj.zone
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

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

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

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

  • nibbler@discuss.tchncs.de
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

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

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

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

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

      Ig its for fish shell

    • Ephera@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      2 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
        0
        ·
        2 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
          0
          ·
          2 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
            0
            ·
            2 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
              0
              ·
              2 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.

    • BCsven@lemmy.ca
      link
      fedilink
      arrow-up
      0
      ·
      2 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
        0
        ·
        2 months ago

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

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

          Oh, LOL

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

    alias fuck="sudo !!"

    • Nilz@sopuli.xyz
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      Wait, you don’t have The Fuck installed?

      • Caveman@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

        Waiting for it to be rewritten in rust

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

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

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

    Why do you not press the up arrow + Pos1?

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

      What is Pos1?

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

    You can do that??

    I always did sudo !!

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

      Well its only for fish shell.

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

          No problem.

  • GarboDog@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    Wait… YOU CAN DO THAT?!

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

      Forgot to mention but only in fish shell.

      • GarboDog@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

        Ah oki lol

        • Mountainaire@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          1 month 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!

  • wpb@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

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

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

  • jenesaisquoi@feddit.org
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    lol no vi mode

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

      Vi mode?

  • RedstoneValley@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    Or press Ctrl-S and take a nice walk outside

    • sem@piefed.blahaj.zone
      link
      fedilink
      English
      arrow-up
      0
      ·
      2 months ago

      I misread this image and have been doing this the past day and it keeps breaking my terminal :(

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

    MaNLkfuwl4LB6ck.jpg

    • Ephera@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

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

      • Axolotl@feddit.it
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

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

      • Nilz@sopuli.xyz
        link
        fedilink
        arrow-up
        0
        ·
        2 months 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
          0
          ·
          2 months ago

          I don’t dabble in black magic. /j

          It’s actually pretty neat.

      • printf("%s", name);@piefed.blahaj.zone
        link
        fedilink
        English
        arrow-up
        0
        ·
        2 months 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
          0
          ·
          2 months 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.

        • gankouskhan@piefed.zip
          link
          fedilink
          English
          arrow-up
          0
          ·
          1 month ago

          Actually, after kinematic analysis of the required fingertip trajectories upheaves both of these arguments. If you calculate the aggregate spatial displacement across a standard 2D Euclidean plane for both input strings, the former macro sequence yields a significantly lower metric footprint than the latter.

          For the sake of empirical demonstration, we can map this across a standard ANSI 100% layout using a normalized key pitch constraint where 1 U = 19.05 mm. By establishing a Home Row Idle-State Matrix as our behavioral anchor and tracking independent multi-finger vectors using the standard Pythagorean metric tensor—calculating the straight-line distance d = sqrt( delta_x^2 + delta_y^2 ) between consecutive keystroke coordinates—we arrive at the following quantitative breakdown:

          Macro Sequence 1: sudo [shift] !! [enter]

          • Single-Handed Vector String: 40.878 U
            • Net Linear Displacement: 778.7 mm
          • Dual-Handed Touch-Typing Matrix: 8.424 U
            • Net Linear Displacement: 160.5 mm

          Macro Sequence 2: [up] [home] sudo [space] [enter]

          • Single-Handed Vector String: 40.989 U
            • Net Linear Displacement: 780.8 mm
          • Dual-Handed Touch-Typing Matrix: 21.728 U
            • Net Linear Displacement: 413.9 mm

          tl;dr

          Fewer keystrokes != less work. Even though typing !! looks like more work, it isn’t because your finger travel distance is significantly shorter when executing those keys using two-handed touch typing on a standard ANSI QWERTY keyboard.

          • printf("%s", name);@piefed.blahaj.zone
            link
            fedilink
            English
            arrow-up
            0
            ·
            1 month ago

            Edit: I will forward your thesis to the cat.

            My day started out catastrophically bad, resulting in taking a sick day.

            Then came you.

            I cried and laughed in some sequence and it gave me the energy to get out of bed. Now, I will have breakfast*.

            *Loose definition.

            • gankouskhan@piefed.zip
              link
              fedilink
              English
              arrow-up
              0
              ·
              1 month ago

              bows thank you thank you. Glad about my efforts being well received, and even more so it got you out of bed! Cheers and may your day remain on the up.

    • SkaveRat@discuss.tchncs.de
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      Ctrl A is easier to reach than the home key

      • ClownStatue@piefed.social
        link
        fedilink
        English
        arrow-up
        0
        ·
        2 months 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
          0
          ·
          2 months 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
            0
            ·
            2 months 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

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

      Ayo chill

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

        I approve of the ice to coke ratio. I am now chill.

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

          Good

    • certified_expert@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago
      • ctrl + p
      • ctrl + a
      • sudo [space]
      • enter
      • obnomus@lemmy.mlOP
        link
        fedilink
        English
        arrow-up
        0
        ·
        2 months ago

        How about just one keyboard shortcut and enter.

  • Albbi@piefed.ca
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months 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.

    • softwarist@programming.dev
      link
      fedilink
      English
      arrow-up
      0
      ·
      2 months ago

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

  • b161@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    sudo !!

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

      For some reason I get this

      • wpb@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

        Use zsh

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

          It works.

  • eco_game@discuss.tchncs.de
    link
    fedilink
    arrow-up
    0
    ·
    2 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.

    • Dionysus@leminal.space
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      Need to use the fish shell instead of the others for this to work. (May be a way to enable it in other shells but I’m not sure how)

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

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

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

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

        • Ephera@lemmy.ml
          link
          fedilink
          arrow-up
          0
          ·
          edit-2
          2 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…

          • softotteep@pawb.social
            link
            fedilink
            English
            arrow-up
            0
            ·
            2 months ago

            THAT’S WHAT IT’S FOR??

            Now that I think about it, it does seem pretty obvious.

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

          It’s part of the terminal emulator flow control

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

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

    • dracc@discuss.tchncs.de
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

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

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

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

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

      Bruh

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

          Fish

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

                  I’ll try thanks for the recommendation.

    • devfuuu@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      Not all shells support that.

      I use fish btw.

      • NannerBanner@literature.cafe
        link
        fedilink
        arrow-up
        0
        ·
        2 months 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
          0
          ·
          2 months ago
          echo $SHELL
          
          • NannerBanner@literature.cafe
            link
            fedilink
            arrow-up
            0
            ·
            2 months ago

            Lol, thanks. Now I know.

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

        I made my own !!

        • ArchAengelus@lemmy.dbzer0.com
          link
          fedilink
          arrow-up
          0
          ·
          2 months 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
        0
        ·
        2 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

        • tekino@pawb.social
          link
          fedilink
          arrow-up
          0
          ·
          2 months 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

        • eneff@discuss.tchncs.de
          link
          fedilink
          arrow-up
          0
          ·
          2 months ago

          … are you not aware of Alt+S?!

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

            Nope haha. Thanks for letting me know

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

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

          Does your keyboard not have a home key?

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

            Didn’t know home key could do that lol.

    • adeoxymus@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      I completely forgot about this one!

    • juipeltje@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

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

    • Sarcasmo220@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      I learned something new today!

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

      wish i could alias that

      alias ffs=“sudo !!”

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

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

        • TedZanzibar@feddit.uk
          link
          fedilink
          English
          arrow-up
          0
          ·
          2 months ago

          Just to confirm: I tried this, it works.

      • Caveman@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

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

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

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

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.

  • 111 users / day
  • 151 users / week
  • 775 users / month
  • 2.78K users / 6 months
  • 0 local subscribers
  • 32.1K subscribers
  • 694 Posts
  • 8.68K Comments
  • Modlog
  • mods:
  • zephyr@lemmy.world
  • Err(()).unwrap()@lemmy.world
  • BE: 0.19.18
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org