Как открыть файл, когда 'vi' сообщает, что он уже открыт?

По какой-то причине, когда я пытаюсь редактировать vi .profile, терминал постоянно говорит мне, что у меня уже есть .profile в режиме редактирования.

E325: ATTENTION
Found a swap file by the name ".profile.swp"
          owned by: smaranh   dated: Fri Apr  6 09:46:45 2012
         file name: ~smaranh/.profile
          modified: YES
         user name: smaranh   host name: ubuntu
        process ID: 4394
While opening file ".profile"
             dated: Fri Apr 27 10:35:32 2012
      NEWER than swap file!

(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 .profile"
    to recover the changes (see ":help recovery").
    If you did this already, delete the swap file ".profile.swp"
    to avoid this message.
".profile" 23 lines, 713 characters
Press ENTER or type command to continue

Итак, я попытался убить процесс, который показывалось в приведенном выше сообщении, но он продолжает показывать No such process.

Затем я использовал ps -ef | grep 4394 и получил этот вывод,

smaranh   3491  3375  0 10:08 pts/3    00:00:00 grep --color=auto 4394

Так что я попробовал kill -9 3491, но он все равно дал мне No such process. Не уверены, что не так?

Как закрыть уже открытый .profile?

10
задан 28 December 2012 в 07:33

1 ответ

Это старый файл подкачки, который все еще там, потому что редактор, вероятно, упал или был убит. Вы можете безопасно стереть его.

rm .profile.swp
0
ответ дан 28 December 2012 в 07:33

Другие вопросы по тегам:

Похожие вопросы: