When you realized you forgot sudo

https://lemmy.world/post/13497675

When you realized you forgot sudo - Lemmy.World

Is there an editor that can request root privileges without restarting it? That would be quite useful.

It’s a simple trick in Vim:

stackoverflow.com/a/7078429

For the lazy: :w !sudo tee > /dev/null %

How does the vim "write with sudo" trick work?

Many of you have probably seen the command that allows you to write on a file that needs root permission, even when you forgot to open vim with sudo: :w !sudo tee % The thing is that I don't get ...

Stack Overflow