ubuntu empty swap code example
Example 1: clear swap memory linux
sudo swapoff -a; sudo swapon -a
Example 2: ubuntu turn off swap
sudo swapoff -a && sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
sudo swapoff -a; sudo swapon -a
sudo swapoff -a && sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab