LoginSignup
41
40

More than 5 years have passed since last update.

sudoを付けずにVimでルート権限のファイルを編集してしまった時

Last updated at Posted at 2016-07-16

顔面蒼白ですよね。
安心して以下を実行します。

対処法

コマンドモードで以下のコマンドを叩く
:w !sudo tee %
パスワードを聞かれるので入力し、:q!でVimを閉じれば完了
ちゃんと編集内容が保存されます。

41
40
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
41
40