How do I get root permission for my file inside vi?
:w !sudo tee %
command W w !sudo tee % >/dev/null
cmap w!! w !sudo tee >/dev/null %
Source: By Paul Wicks as answer to the question
This code snippet was collected from stackoverflow, and is licensed under CC BY-SA 2.5
Related code-snippets:
- How can I get the value of in a loop?
- Is gettimeofday() guaranteed to be of microsecond resolution?
- What is error log per Virtual Host?
- What's the API for GTK messagebox?
- Windows Equivalent of 'nice'.
- Can I use Xming X Window Server over a VPN?
- How can I kill Linux processes older than a certain age?
- How can I fix the Java Time Zone?
- Date arithmetic in Unix shell scripts.
- What's a quicker way to find duplicates conditioned by time?
- How do I encode XML files to XFS,?
- How do I show a GUI message box in Linux?
- How can I setup public key authentication?
- How to avoid redefining VERSION, PACKAGE, etc. How to avoid redefining VERSION, PACKAGE, etc.?
- How's your.procmailrc file?