58
47

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

読み取り専用ファイルを編集する

Posted at

vimで読み取り専用ファイルを編集したいときのコマンド。

まず、ファイルを開くときは、

$ sudo vim <ファイル名>

と実行。

そして、vimで上書き保存するときは

:w !sudo tee %

と実行。

閉じるときは、

:q!

と実行。

これで完璧!

58
47
0

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
58
47

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?