
post
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
Not all shells support that.
I use fish btw.
I made my own !!
I don't even know what I use anymore. My distro seems to keep changing it when I reinstall.
alias fuck="sudo !!"
Waiting for it to be rewritten in rust
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
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.
I used to have an alias 'please' for that.
Wait⦠YOU CAN DO THAT?!
Forgot to mention but only in fish shell.
Or press Ctrl-S and take a nice walk outside
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
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...
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.
Ctrl + S freezes your shell yes. But Alt + S?
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)
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.
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.
<Esc> k I sudo <Space> <Enter>
top 50 comments