Delete .swp file in linux
Situation
Why is it happened?
If you use vim(vi) or Neovim, and if it closed unexpectly, it creates .swp file to recover. If you just leave .swp file, it does not matter, but you will encounter this screen everytime you try to access the file.
How to solve this?
If you type ls -a , you can see .swp file. (Since it is hidden, you can’t see this with
ls
)
You can simply delete that. If you can’t find .swp file, try command below : cd /path/to/directory rm -i [swp file name] # Get confirm message before delete