有时用 VIM 编辑文件时常忘了加上 sudo,在保存时就会提示没有权限。

用命令 :w !sudo tee %

 

Emacs

C-x C-w后提示

Write file: /mnt/study/python.py

这时加上 /sudo::

Write file: /sudo::/mnt/study/python.py

就会有提示输入密码了
Password for /sudo:root@VirtualBox:

相关文章: