LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   how to delete SWAP file (https://www.linuxquestions.org/questions/linux-server-73/how-to-delete-swap-file-4175733999/)

muhitul 02-18-2024 12:02 PM

how to delete SWAP file
 
we use centos7.
File swapped while running vim. Now how to delete the swap file.
Thanks
Muhitul

michaelk 02-18-2024 01:53 PM

The swap file is a hidden file created typically in the same directory as the file you were editing.
.file_name.swp

MilesWeb 02-19-2024 12:59 AM

1. FYI, Vim automatically creates swap files in home directory, that you can find in .vimrc.swp
2. once you find swap files, use below command to delete it,
rm filename.swp

pan64 02-19-2024 01:26 AM

there are two cases
1. vi (or vim) is still running, in that case do not touch it, vi will (should) manage it.
2. it is not in use any more, in that case you can safely delete it by hand.


All times are GMT -5. The time now is 08:39 AM.