Quantcast
Viewing all articles
Browse latest Browse all 5712

vimでsudoを忘れてreadonlyで編集してしまった場合

w !sudo tee%
w : ファイルの保存
!sudo tee : ! にて コマンド「sudo tee」を指示
% : 現在開いているファイル
⇒ 現在開いているファイルに対して、tee コマンドで強制的に上書きすることになります。

q!

http://tm.root-n.com/unix:command:vim:readlonly_write


Viewing all articles
Browse latest Browse all 5712

Trending Articles