ncom
By:
ncom

delete swap file

March 26, 2014 2.7k views
how to delete a swap file?
1 Answer
Run the following commands:
sudo swapoff -a -v

sudo rm /swapfile
#back up /etc/fstab:
sudo cp /etc/fstab /etc/fstab.bak
sudo sed -i '/\/swapfile/d'

The commands should work assuming your swapfile is stored in / and is called "swapfile."
Have another answer? Share your knowledge.