Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

For some reason, when I am trying to edit vi .profile, the terminal keeps telling me that I already have the .profile in the edit mode.

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

So I tried to kill the process that the message above was showing, but it keeps showing No such process.

I then used ps -ef | grep 4394 and got this output,

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

So I tried kill -9 3491 but it still gave me No such process. Not sure what is wrong?

How do I close the already open .profile?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

This is an old swap file that's still there because the editor probably crashed or had been killed. You can safely erase it.

rm .profile.swp
share|improve this answer
    
will i still have the original contents of my .profile file? –  Sam007 Oct 4 '12 at 17:22
1  
NO. Check the edited answer. –  SirCharlo Oct 4 '12 at 17:23
    
@SirCharlo Thanks. –  Eric Carvalho Oct 4 '12 at 17:26
    
@Sam007 Sorry. My mistake. I'm kind of sleepy now... –  Eric Carvalho Oct 4 '12 at 17:27
1  
@Sam007 meta.askubuntu.com/a/3973/65926 –  Eric Carvalho Oct 4 '12 at 17:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.