1. 程式人生 > >vi開啟檔案提示Another program may be editing the same file

vi開啟檔案提示Another program may be editing the same file

linux下兩個人同時開啟同一個檔案會顯示如下介面,而有的時候只有一個賬戶的時候也有這個提示,此時的處理思路是:由於上次沒有關閉開啟的檔案造成的,結束掉程序即可
如兩個使用者同時開啟:vi install.log    會有一個使用者有此提示
E325: ATTENTION
Found a swap file by the name ".install.log.swp"
          owned by: root   dated: Sat May  1 10:52:16 2010
         file name: ~root/install.log
          modified: no
         user name: root   host name: localhost.localdomain
        process ID: 14389 (still running)
While opening file "install.log"
             dated: Sat Jan 30 21:31:27 2010


(1) Another program may be editing the same file.
    If this is the case, be careful not to end up with two
    different instances of the same file when making changes.
    Quit, or continue with caution.


(2) An edit session for this file crashed.
    If this is the case, use ":recover" or "vim -r install.log"
    to recover the changes (see ":help recovery").
    If you did this already, delete the swap file ".install.log.swp"
    to avoid this message.
"install.log" 892L, 33018C
Press ENTER or type command to continue


處理步驟


一、結束程序


[
[email protected]
~]# ps -ef |grep vi
root      7177  7156  0 Apr29 tty7     00:00:00 /usr/bin/whiptail --yesno Failed to start the X server (your graphical interface).  It is likely that it is not set up


correctly.  Would you like to view the X server output to diagnose the problem? 10 50
root     25200 23993  0 22:54 pts/2    00:00:00 vi install.log
root     25234 25197  0 22:55 pts/3    00:00:00 grep vi
[
[email protected]
~]# kill -9 25200
You have new mail in /var/mail/root
[[email protected] ~]#




結束程序後仍然有這個提示




E325: ATTENTION
Found a swap file by the name ".install.log.swp"
          owned by: root   dated: Fri Apr 30 22:54:45 2010
         file name: ~root/install.log
          modified: no
         user name: root   host name: localhost.localdomain
        process ID: 25200
While opening file "install.log"
             dated: Mon Mar  9 03:06:01 2009


(1) Another program may be editing the same file.
    If this is the case, be careful not to end up with two
    different instances of the same file when making changes.
    Quit, or continue with caution.


(2) An edit session for this file crashed.
    If this is the case, use ":recover" or "vim -r install.log"
    to recover the changes (see ":help recovery").
    If you did this already, delete the swap file ".install.log.swp"
    to avoid this message.
"install.log" 1079L, 45902C
Press ENTER or type command to continue


 




步驟二:
此時是由於快取造成的刪除快取即可(註明此時的快取檔案在你開啟的檔案位置並不一定是當前的位置)
[
[email protected]
~]# rm -rf .install.log.swp




此時即可開啟即可正常

相關推薦

vi開啟檔案提示Another program may be editing the same file

linux下兩個人同時開啟同一個檔案會顯示如下介面,而有的時候只有一個賬戶的時候也有這個提示,此時的處理思路是:由於上次沒有關閉開啟的檔案造成的,結束掉程序即可如兩個使用者同時開啟:vi install.log    會有一個使用者有此提示E325: ATTENTIONFou

vi/vim開啟檔案提示Found a swap file by the name

問題分析 有一次在遠端連線主機時,用vi開啟檔案my.ini卻提示:Found a swap file by the name ".my.ini.swp"。百度了下才知道,原來在使用vi或vim命令開啟一個檔案後,就會產生一個.(filename).swp的檔案。如果編輯完成之後,正常退出,那麼這個swp檔

Office2013 開啟檔案提示檔案已損壞的解決辦法

今天從業務OA下載考勤記錄後,用新安裝的office2016開啟,提示:檔案已損壞。用WPS開啟則沒有問題,於是建議用WPS,多人性化,但是由於客戶的office版本可能較高,用WPS 或office2007 都不太相容,造成內容丟壞。沒辦法只能解決問題了。然後百度了一下,大體都差不多,(少了第5步)但就是不

用python開啟檔案提示IOError錯誤怎麼辦?

Python IOErro錯誤主要是指要開啟的檔案不存在的錯誤提示,引起IOError錯誤的可能原因有很多,以下是最可能的原因! 1. 檔案確實不存在 當錯誤的輸入了一個不存在的檔名,並試圖開啟它的時候,程式會因為找不到這個檔名而引發IOError錯誤,這種情況就需要將輸入的檔名修改成正確的

使用vi開啟檔案如何跳到某一行,第一行或者最後一行呢

使用vi編輯器的時候,預設開啟的時候,滑鼠是在第一行的第一個位置。 如果你想開啟的時候,滑鼠會出現在某一行,可以用以下命令。 :$ 跳到檔案最後一行 :0或:1 跳到

yum提示Another app is currently holding the yum lock

holding the yum lockyum提示Another app is currently holding the yum lock; waiting for it to exit...[root@tomcat ~]# yum repolist Another app is currently hol

yum提示Another app is currently holding the yum lock waiting

使用yum安裝計劃任務功能,結果提示: # yum -y install vixie-cron Loaded plugins: fastestmirror, refresh-packagekit, security Existing lock /var/run/yum.pid: another co

Linux工作筆記026---Centos7.3 yum提示Another app is currently holding the yum lock; waiting for it to exit.

這個問題是由於,上午通過堡壘機,裝著,然後到飯點了,去吃飯, 吃飯回來,連結超時,然後裝著的東西就卡在那了... 出現了這個問題 使用yum安裝計劃任務功能,結果提示: # yum -y i

解決linux下sudo更改檔案許可權報錯xxxis not in the sudoers file. This incident will be reported.

Linux中普通使用者用sudo執行命令時報”xxx is not in the sudoers file.This incident will be reported”錯誤,解決方法就是在/etc/sudoers檔案裡給該使用者新增許可權。如下: 1.切

解決VS開啟檔案出現No EditorOptionDefinition export found for the given option name問題

轉載自http://stackoverflow.com/questions/23893497/no-editoroptiondefinition-export-found-error的第一個回答 After a reboot and some more researc

Eclipse啟動時提示An error has occurred.See the log file D:\eclipse\configuration\...

今天在群裡碰到一位同學問的問題,突然想到之前自己碰到過類似的問題,就總結下吧,建議大家遇到問題儘量不要直接在群裡問,嘗試著在網上查詢下看看自己能否解決問題,自己解決的印象最深刻的。 我的eclipse

Eclipse每次修改檔案之後,tomcat要自動重新部署,就會報這個錯誤:May be locked by another process

tomcat啟動後,每次修改檔案後,tomcat會自動重新部署,就會報如下錯誤: Publishing failed with multiple errors Could not delete D:\

64位word2013 Excel 2013提示記憶體不足,PowerPoint 2013無法開啟檔案的一個解決方案

分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow 也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!        

Pycharm提示方法Method xxx may be 'static'

使用Pycharm進行Python開發時,在類中定義方法時,若該方法不涉及對屬性的操作,那麼Pycharm會提示Method xxx may be 'static',因為Pycharm會認為該方法是一個靜態方法,而不是類方法,所提提示我們在該方法前新增@staticmethod裝飾器進行裝飾。

spring pom檔案報錯:提示no declaration can be found for element 'dubbo:service'.

pom檔案報錯:The matching wildcard is strict, but no declaration can be found for  element 'dubbo:service'. 解決辦法: 找到dubbo的jar包,解壓後在META-INF

linux下vi/vim開啟檔案異常及處理方法

用vi/vim開啟之前寫過的c程式碼,會多次出現這個狀況:    網易有道詞典翻譯如下: 檔案 編輯 檢視 搜尋 終端 幫助 E325:注意 找到一個名為“.mybash.c.swp”的交換檔案 業主:fr 日期:2018年11月11日11:31:55

vss刪除檔案後報錯誤:File names.dat may be corrupt 修復

刪除VSS的Data目錄下的所有backup。 出現這個錯誤的時候,只要從命令視窗CD到VSS的安裝目錄下的win32目錄中。  執行 "ANALYZE.EXE -X E:/VSS/data" (後面添對應的目錄)。  便會找出對應的出錯的檔案。  再 “ANALYZ

Win10系統開啟共享檔案提示沒有許可權使用網路資源怎麼處理?

n10系統在訪問網路中的共享檔案時提示“xxx計算機無法訪問,您可能沒有許可權使用網路資源。請與這臺伺服器的管理員聯絡以查明您是否有訪問許可權”的提示,該提示來賓賬戶出現許可權問題導致的,我們只要新增Windows憑證就可以解決。   操作步驟:   1、開控制面

navicat for mysql 匯入xlsx,提示 無法開啟檔案

試試 先開啟要匯入的 excel表格,然後再次操作匯入步驟; 檢查如果安裝的office是64位的,Navicat也要64位才行,32位的也是一樣。另外在匯入的時候excel必須是開啟的狀態。跟office和Navicat的版本號是沒有關係的。

vi --開啟檔案的操作 【轉】

多標籤進入vim前 vim -p <檔名> 以多標籤形式開啟檔案。如vim -p * 就是編輯當前目錄的所有檔案, vim編輯中 :tabnew 增加一個標籤 :tabc