注释swap分区

grep  "#" fstab |grep "swap" >/dev/null || sed -i 's/^.*swap/#&/g' fstab
原文地址:https://www.cnblogs.com/xlovepython/p/14600687.html