Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
duck
on March 18, 2010
|
parent
|
context
|
favorite
| on:
Top Ten One-Liners from CommandLineFu Explained
#3. Save a file you edited in vim without the needed permissions
:w !sudo tee %
I've used vim for a long time, but didn't know about this one.
erlanger
on March 18, 2010
[–]
Of course it assumes sudo's present.
Consider applying for YC's Summer 2026 batch! Applications are open till May 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
:w !sudo tee %
I've used vim for a long time, but didn't know about this one.