Removing the sleepimage file in /var/vm in macOS permanently I run high sierra, and the large private/var/vm/sleepimage file has been bothering me. My computer has 16 GB of ram, which means sleepimage takes up 16 GB on my drive. I have read tutorials on how to remove it, but it does not work for me. I tried typing sudo rm -R private/var/vm/sleepimage in the terminal, but the terminal responds rm: private/var/vm/sleepimage: No such file or directory. What do I do?
That file can be deleted - no need for -R but be sure to have the full path:

 sudo rm /private/var/vm/sleepimage


One you "delete it", the space will not be freed until the kernel and other processes close the file, so restart your Mac. The image file will be recreated next time you need to sleep - so if you had a HDD with that file contiguously allocated, you will make things worse when it's allocated non-contiguous blocks. SSD won't care either way.

I would focus on cleaning / relocating other files long term than this one.