delete swap file

March 26, 2014 5.1k 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.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!