歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> 學習Linux >> vi編輯文件保存後,提示“Can't open file for writing Press ENTER or type command to continue”,viwriting

vi編輯文件保存後,提示“Can't open file for writing Press ENTER or type command to continue”,viwriting

日期:2017/3/3 17:31:02   编辑:學習Linux

vi編輯文件保存後,提示“Can't open file for writing Press ENTER or type command to continue”,viwriting


熱度3 評論 163 www.BkJia.Com 網友分享於: 2017-02-18 04:02:48 浏覽數2214次

vi編輯文件保存後,提示“Can't open file for writing Press ENTER or type command to continue”,viwriting


在linux上使用vi命令修改或者編輯一個文件內容的時候,最後發現使用<Esc+:+wq!>無法保存退出,卻出現,如下提示:

E212: Can't open file for writing Press ENTER or type command to continue

出現這個錯誤的原因可能有兩個:
1.當前用戶的權限不足;
2.此文件可能正被其他程序或用戶使用。
一般錯誤原因都是前者,解決方案是在使用vi命令打開文件時,前面加上sudo來臨時提供管理員權限,比如使用命令“sudo vi test.txt”打開編輯文件。


由此看來,sudo命令是很有用的,當我們執行某種操作系統提示諸如“operation not permitted”等權限不足信息時,我們很多時候都可以在命令前面加上sudo來解決權限不足問題。

比如從linux服務器上下載某一個文件或上傳某一個文件有可能提示這個,也有肯能直接上傳不成功但是什麼都沒提示;這時可以考慮是不是賬號的權限不足,加個sudo試試。

http://www.bkjia.com/Linuxjc/1193932.html TechArticle

Copyright © Linux教程網 All Rights Reserved