472
Noice (thelemmy.club)
submitted 1 month ago by Obnomus@lemmy.ml to c/linuxmemes@lemmy.world
top 50 comments
sorted by: hot top new old
[-] akunohana@piefed.blahaj.zone 148 points 1 month ago
[-] Ephera@lemmy.ml 33 points 1 month ago

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

[-] akunohana@piefed.blahaj.zone 62 points 1 month ago* (last edited 1 month 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 16 points 1 month 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 6 points 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.

load more comments (2 replies)
[-] Axolotl_cpp@feddit.it 19 points 1 month ago

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

[-] Nilz@sopuli.xyz 13 points 1 month ago

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

[-] akunohana@piefed.blahaj.zone 9 points 1 month ago

I don't dabble in black magic. /j

It's actually pretty neat.

[-] SkaveRat@discuss.tchncs.de 17 points 1 month ago

Ctrl A is easier to reach than the home key

load more comments (3 replies)
load more comments (3 replies)
[-] olafurp@lemmy.world 144 points 1 month ago* (last edited 1 month ago)

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

[-] juipeltje@lemmy.world 78 points 1 month ago

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

load more comments (1 replies)
[-] devfuuu@lemmy.world 27 points 1 month ago

Not all shells support that.

I use fish btw.

[-] protogen420@lemmy.blahaj.zone 17 points 1 month ago
[-] ArchAengelus@lemmy.dbzer0.com 18 points 1 month 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

[-] NannerBanner@literature.cafe 7 points 1 month ago

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

[-] unbuckled_easily933@lemmy.ml 9 points 1 month ago
[-] NannerBanner@literature.cafe 5 points 1 month ago

Lol, thanks. Now I know.

load more comments (8 replies)
[-] Sarcasmo220@lemmy.ml 16 points 1 month ago

I learned something new today!

[-] adeoxymus@lemmy.world 6 points 1 month ago

I completely forgot about this one!

load more comments (12 replies)
[-] ikidd@lemmy.dbzer0.com 74 points 1 month ago
[-] Nilz@sopuli.xyz 38 points 1 month ago

Wait, you don't have The Fuck installed?

[-] olafurp@lemmy.world 7 points 1 month ago

Waiting for it to be rewritten in rust

load more comments (1 replies)
[-] imsufferableninja@sh.itjust.works 21 points 1 month 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.ml 7 points 1 month ago

Yeah I remembered that after uploading the meme.

[-] albbi@piefed.ca 17 points 1 month 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 8 points 1 month ago

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

load more comments (1 replies)
[-] nibbler@discuss.tchncs.de 15 points 1 month ago

I used to have an alias 'please' for that.

load more comments (1 replies)
[-] GarboDog@lemmy.world 15 points 1 month ago
[-] Obnomus@lemmy.ml 6 points 1 month ago

Forgot to mention but only in fish shell.

load more comments (3 replies)
[-] RedstoneValley@sh.itjust.works 12 points 1 month ago

Or press Ctrl-S and take a nice walk outside

load more comments (1 replies)
[-] b161@lemmy.blahaj.zone 11 points 1 month ago
load more comments (3 replies)
[-] eco_game@discuss.tchncs.de 9 points 1 month 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.

[-] imsufferableninja@sh.itjust.works 15 points 1 month ago

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

[-] eco_game@discuss.tchncs.de 6 points 1 month ago

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

[-] Ephera@lemmy.ml 9 points 1 month ago* (last edited 1 month 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...

[-] solxix@pawb.social 13 points 1 month ago

THAT'S WHAT IT'S FOR??

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

[-] neclimdul@lemmy.world 5 points 1 month 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.

load more comments (1 replies)
load more comments (1 replies)
[-] dracc@discuss.tchncs.de 9 points 1 month ago

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

[-] eco_game@discuss.tchncs.de 6 points 1 month ago

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

[-] Dionysus@leminal.space 8 points 1 month 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)

[-] TrickDacy@lemmy.world 7 points 1 month ago* (last edited 1 month ago)

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

[-] cyberpunk007@lemmy.ca 9 points 1 month 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 7 points 1 month 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 5 points 1 month ago* (last edited 1 month 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.

load more comments (1 replies)
load more comments (5 replies)
load more comments (1 replies)
[-] wpb@lemmy.world 5 points 1 month ago* (last edited 1 month ago)

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

load more comments (1 replies)
load more comments
view more: next ›
this post was submitted on 26 May 2026
472 points (98.0% liked)

linuxmemes

32187 readers
2812 users here now

Hint: :q!


Sister communities:


Community rules (click to expand)

1. Follow the site-wide rules

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 figuresWe 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.

    founded 3 years ago
    MODERATORS