disable swap ubuntu 20.04 code example Example: ubuntu turn off swap sudo swapoff -a && sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab