Ubuntu: How to delete the .swp files when working remotely



Question:

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

E325: ATTENTION  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/main.build.3616.BR_PS_1109.2239/..../searchRefineVertTabs.jsp            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`


Solution:1

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"  


Solution:2

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


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »