4 ms·
no matter what you editor you use, set EDITOR to whatever you want, then when you want to edit files as root do `sudo -e /path/to/file` thanks me later
by rubyist5eva 5y ago
no matter what you editor you use, set EDITOR to whatever you want, then when you want to edit files as root do `sudo -e /path/to/file`
thanks me later
- _def 5y agoThe more you know. Thanks!
- darnir 5y agoOr even simpler use `sudoedit /path/to/file/`
- rubyist5eva 5y agosudo -e is less characters to type tho, though I guess you can do sudoe<TAB> and complete it...choices, choices
- throaway46546 5y agoHow is it better than `sudo vi /path/to/file`?
- dllthomas 5y ago`sudo vi` runs vi as root, which means 1) it won't have your users configurations, and 2) it's probably way the hell over-privileged for what you are trying to do. `sudoedit` (and equivalently `sudo -e`) makes a copy of the file that you can edit and then copies it back as root iff it's changed.
- throaway46546 5y agoThanks!