RetroFed Forum
Your home away from modern life.
Noice
Post Reply
AuthorMessage
obnomus lemmy.ml Obnomus@lemmy.ml
Joined: 2024-06-16
Quote

472   Original
eco_game discuss.tchncs.de eco_game@discuss.tchncs.de
Joined: 2023-06-17
#2 · Quote Reply

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.

9
Dionysus leminal.space Dionysus@leminal.space
Joined: 2025-09-13
#3 · Quote Reply

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.

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)

8
insufferableninja sh.itjust.works imsufferableninja@sh.itjust.works
Joined: 2024-11-26
#4 · Quote Reply

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.

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

15
insufferableninja sh.itjust.works imsufferableninja@sh.itjust.works
Joined: 2024-11-26
#5 · Quote Reply

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

21
obnomus lemmy.ml Obnomus@lemmy.ml
Joined: 2024-06-16
#6 · Quote Reply

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

Yeah I remembered that after uploading the meme.

7
dracc discuss.tchncs.de dracc@discuss.tchncs.de
Joined: 2025-09-25
#7 · Quote Reply

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.

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

9
Caveman lemmy.world olafurp@lemmy.world
Joined: 2023-08-19
#8 · (edited) Quote Reply

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

144
adeoxymus lemmy.world adeoxymus@lemmy.world
Joined: 2023-07-01
#9 · Quote Reply

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

I completely forgot about this one!

6
screaming in digital lemmy.ml qprimed@lemmy.ml
Joined: 2023-05-07
#10 · Quote Reply

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

x๐Ÿ‘off๐Ÿ‘...
x๐Ÿ‘on๐Ÿ‘...
x๐Ÿ‘off๐Ÿ‘, x๐Ÿ‘on๐Ÿ‘...flowcontrol.

3
devfuuu lemmy.world devfuuu@lemmy.world
Joined: 2023-06-17
#11 · Quote Reply

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

Not all shells support that.

I use fish btw.

27
juipeltje lemmy.world juipeltje@lemmy.world
Joined: 2023-07-02
#12 · Quote Reply

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

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

78
TrickDacy lemmy.world TrickDacy@lemmy.world
Joined: 2023-07-27
#13 · (edited) Quote Reply

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

7
ikidd lemmy.dbzer0.com ikidd@lemmy.dbzer0.com
Joined: 2026-04-23
#14 · Quote Reply

alias fuck="sudo !!"

75
eco_game discuss.tchncs.de eco_game@discuss.tchncs.de
Joined: 2023-06-17
#15 · Quote Reply

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

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

6
eco_game discuss.tchncs.de eco_game@discuss.tchncs.de
Joined: 2023-06-17
#16 · Quote Reply

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

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

6
muhyb programming.dev muhyb@programming.dev
Joined: 2023-07-05
#17 · Quote Reply

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

2
yeehaw lemmy.ca cyberpunk007@lemmy.ca
Joined: 2023-08-09
#18 · Quote Reply

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

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

9
BCsven lemmy.ca BCsven@lemmy.ca
Joined: 2023-06-17
#19 · Quote Reply

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

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

1
TrickDacy lemmy.world TrickDacy@lemmy.world
Joined: 2023-07-27
#20 · Quote Reply

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

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.

6
furry toaster lemmy.blahaj.zone protogen420@lemmy.blahaj.zone
Joined: 2025-01-04
#21 · Quote Reply

Not all shells support that. I use fish btw.

I made my own !!

17
RedstoneValley sh.itjust.works RedstoneValley@sh.itjust.works
Joined: 2023-07-24
#22 · Quote Reply

Or press Ctrl-S and take a nice walk outside

12
NannerBanner literature.cafe NannerBanner@literature.cafe
Joined: 2025-12-27
#23 · Quote Reply

Not all shells support that. I use fish btw.

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

7
muhyb programming.dev muhyb@programming.dev
Joined: 2023-07-05
#24 · Quote Reply

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

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

5
ArchAengelus lemmy.dbzer0.com ArchAengelus@lemmy.dbzer0.com
Joined: 2023-12-21
#25 · Quote Reply

I made my own !!

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

18
insufferableninja sh.itjust.works imsufferableninja@sh.itjust.works
Joined: 2024-11-26
#26 · Quote Reply

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

It's part of the terminal emulator flow control

4
Sarcasmo220 lemmy.ml Sarcasmo220@lemmy.ml
Joined: 2022-03-19
#27 · Quote Reply

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

I learned something new today!

16
printf("%s", name); piefed.blahaj.zone akunohana@piefed.blahaj.zone
Joined: 2026-03-30
#28 · Quote Reply

MaNLkfuwl4LB6ck.jpg

148
neclimdul lemmy.world neclimdul@lemmy.world
Joined: 2023-07-01
#29 · Quote Reply

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

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.

5
Albbi piefed.ca albbi@piefed.ca
Joined: 2025-06-25
#30 · Quote Reply

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.

17
yeehaw lemmy.ca cyberpunk007@lemmy.ca
Joined: 2023-08-09
#31 · Quote Reply

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.

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

3
BCsven lemmy.ca BCsven@lemmy.ca
Joined: 2023-06-17
#32 · Quote Reply

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

Oh, LOL

3
Ephera lemmy.ml Ephera@lemmy.ml
Joined: 2020-05-31
#33 · (edited) Quote Reply

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

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

9
unbuckled_easily933 lemmy.ml unbuckled_easily933@lemmy.ml
Joined: 2025-01-22
#34 · Quote Reply

I don't even know what I use anymore. My distro seems to keep changing it when I reinstall.
echo $SHELL
9
Ephera lemmy.ml Ephera@lemmy.ml
Joined: 2020-05-31
#35 · Quote Reply

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

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

6
Ephera lemmy.ml Ephera@lemmy.ml
Joined: 2020-05-31
#36 · Quote Reply

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

31
SkaveRat discuss.tchncs.de SkaveRat@discuss.tchncs.de
Joined: 2023-07-09
#37 · Quote Reply

Ctrl A is easier to reach than the home key

17
Nilz sopuli.xyz Nilz@sopuli.xyz
Joined: 2023-06-01
#38 · Quote Reply

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

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

13
printf("%s", name); piefed.blahaj.zone akunohana@piefed.blahaj.zone
Joined: 2026-03-30
#39 · (edited) Quote Reply

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

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.

62
Nilz sopuli.xyz Nilz@sopuli.xyz
Joined: 2023-06-01
#40 · Quote Reply

alias fuck="sudo !!"

Wait, you don't have The Fuck installed?

38
printf("%s", name); piefed.blahaj.zone akunohana@piefed.blahaj.zone
Joined: 2026-03-30
#41 · Quote Reply

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

I don't dabble in black magic. /j

It's actually pretty neat.

11
muhyb programming.dev muhyb@programming.dev
Joined: 2023-07-05
#42 · Quote Reply

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

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. :)

3
clif lemmy.world clif@lemmy.world
Joined: 2023-06-11
#43 · (edited) Quote Reply

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.

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.

5
Axolotl feddit.it Axolotl_cpp@feddit.it
Joined: 2025-10-10
#44 · Quote Reply

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

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

19
softotteep pawb.social solxix@pawb.social
Joined: 2025-12-03
#45 · Quote Reply

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

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

Not if you don't type your password.

1
softotteep pawb.social solxix@pawb.social
Joined: 2025-12-03
#46 · Quote Reply

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

THAT'S WHAT IT'S FOR??

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

13
yeehaw lemmy.ca cyberpunk007@lemmy.ca
Joined: 2023-08-09
#47 · Quote Reply

But if you typed in sudo !! Right after, then you're really fucked. Not if you don't type your password.

I assume if you are silly enough to type in rm -rf /etc, then you are silly enough to type in your password ๐Ÿ˜…

2
ClownStatue piefed.social ClownStatue@piefed.social
Joined: 2025-05-13
#48 · Quote Reply

Ctrl A is easier to reach than the home key

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

4
ClownStatue piefed.social ClownStatue@piefed.social
Joined: 2025-05-13
#49 · Quote Reply

But if you typed in sudo !! Right after, then you're really fucked. Not if you don't type your password.

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

3
softwarist programming.dev softwarist@programming.dev
Joined: 2025-05-29
#50 · Quote Reply

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.

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

8
NannerBanner literature.cafe NannerBanner@literature.cafe
Joined: 2025-12-27
#51 · Quote Reply

echo $SHELL

Lol, thanks. Now I know.

5
Post Reply Page 1 of 3   Goto page 1, 2, 3 Last »
Back to top