Question: how to delete swap file?
Answer: Become superuser.
Remove the swap space. # /usr/sbin/swap -d /path/filename. ... 
Edit the /etc/vfstab file and delete the entry for the swap file.
Recover the disk space so that you can use it for something else. # rm /path/filename. ... 
Verify that the swap file is no longer available. # swap -l.