當我在linux下用vi打開p1.c檔案時
root@iZ2zeeailqvwws5dcuivdbZ:~/1/01/指針# vi p1.c
會出現如下資訊:
1 E325: ATTENTION
2 Found a swap file by the name ".p1.c.swp"
3 owned by: root dated: Fri Jan 5 19:57:58 2018
4 file name: ~root/1/01/指針/p1.c
5 modified: YES
6 user name: root host name: iZ2zeeailqvwws5dcuivdbZ
7 process ID: 10876
8 While opening file "p1.c"
9 dated: Fri Jan 5 19:51:30 2018
10
11 (1) Another program may be editing the same file. If this is the case,
12 be careful not to end up with two different instances of the same
13 file when making changes. Quit, or continue with caution.
14 (2) An edit session for this file crashed.
15 If this is the case, use ":recover" or "vim -r p1.c"
16 to recover the changes (see ":help recovery").
17 If you did this already, delete the swap file ".p1.c.swp"
18 to avoid this message.
19
20 Swap file ".p1.c.swp" already exists!
21 [O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:
上面的兩段話(1)(2)的翻譯是:
(1)另一個程式可能正在編輯同一個檔案。 如果是這種情況,請注意在進行更改時不要以相同檔案的兩個不同執行個體結束。 退出,或繼續謹慎。
(2)此檔案的編輯會話崩潰。如果是這種情況,請使用“:recover”或“vim -r p1.c”來恢複更改(請參閱“:help recovery”)。如果已經這樣做, 删除交換檔案“.p1.c.swp”以避免此消息。
原因是我之前有一次使用vi 操作 p1.c 檔案時出現了異常中斷,與伺服器中斷連接配接了,是以我重新連接配接伺服器後,用 i p1.c 檢視時,在目前目錄下産生了一個 .p1.c.swp 檔案。
但是我使用ls指令檢視該目錄下,卻發現沒有這個檔案,後來使用ls -a指令檢視才知道 .p1.c.swp 是一個隐藏檔案。
注:以.開頭的檔案就是隐藏檔案哦。
當我把該隐藏檔案删除後再次打開就沒有上面的警告了。
root@iZ2zeeailqvwws5dcuivdbZ:~/1/01/指針# rm .p1.c.swp
root@iZ2zeeailqvwws5dcuivdbZ:~/1/01/指針#
我的GitHub位址:
https://github.com/heizemingjun我的部落格園位址:
http://www.cnblogs.com/chenmingjun我的螞蟻筆記部落格位址:
http://blog.leanote.com/chenmingjunCopyright ©2018 黑澤明軍
【轉載文章務必保留出處和署名,謝謝!】