技巧46-以超级用户权限保存文件
- 修改一个需要sudo文件权限的文件时是无法保存的,保存的方法是:
vim /etc/host
:w !sudo tee % > /dev/null
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
vim /etc/host
:w !sudo tee % > /dev/null