Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I opened a file in vi, but unfortunately while changing it the terminal crashed. Now when I Try to open the same file again in a new session it displays the following message

Found a swap file by the name ".searchRefineVertTabs.jsp.swp"
          owned by: nextag   dated: Tue Mar  5 03:30:12 2013
         file name: ~nt/deploy/main/
          modified: YES
         user name: nextag   host name: li1
        process ID: 9241
While opening file "searchRefineVertTabs.jsp"
             dated: Tue Mar  5 03:35:51 2013
      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 searchRefineVertTabs.jsp"
    to recover the changes (see ":help recovery").
    If you did this already, delete the swap file ".searchRefineVertTabs.jsp.swp"
    to avoid this message.

I want to know how can i delete this .swp file. I couldn't find it on the path filepath/...../outpdir1`

share|improve this question
Have you checked ~nextag/deploy/main/ for that file? – Mostafa Shahverdy Mar 5 '13 at 11:55
yes i checked that, and that is what i mentioned in the last line – vipin8169 Mar 5 '13 at 11:59
Edited my answer ;) – Mostafa Shahverdy Mar 5 '13 at 12:02
up vote 2 down vote accepted

During that alert you can press D . Or else have a look in your current directory in your local machine.

Edit:You can also search for the file with:

find | grep ".searchRefineVertTabs.jsp.swp"
share|improve this answer
I am accessing that file remotely, not locally – vipin8169 Mar 5 '13 at 11:51
yeah, but with some configurations .swp file is stored localy – Mostafa Shahverdy Mar 5 '13 at 11:52
can you please elaborate. Tried using D it didn't work – vipin8169 Mar 5 '13 at 11:53
yeah it worked. Thanks – vipin8169 Mar 5 '13 at 12:10
the file was at the following path: ./.searchRefineVertTabs.jsp.swp so used rm ./.searchRefineVertTabs.jsp.swp – vipin8169 Mar 5 '13 at 12:11

The .swp file will be generate at where your original file is there. SO just delete that file .

Suppose you have file.txt at /usr/local/src/ , then your .file.txt.swp file will be create at /usr/local/src/.

just remove it then open open your original file. it wont give you options like readonly, edit etc

share|improve this answer

Your Answer


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.