3 ms·
When I vi a read-only file: "/etc/mail/aliases" [Read only] 36 lines, 1023 characters Its simply a matter of remaining keen when doing admin tasks. Sure
by TheCapn 14y ago
When I vi a read-only file:
"/etc/mail/aliases" [Read only] 36 lines, 1023 characters
Its simply a matter of remaining keen when doing admin tasks. Sure I have to close/re-open with sudo but its prompting me up front that I won't be able to save it.
- FuzzyDunlop 14y agoYou can do something like this instead (IIRC): :w !sudo tee % > /dev/null It's a bit of a hack, but it works.
- anoother 14y ago> Sure I have to close/re-open with sudo but its prompting me up front that I won't be able to save it. No, you don't, and yes, you will: :w !sudo tee %