Create 100GB swap file in one line

How toLinux

Create 100GB swap file in Linux using a single line.

The file will be named swapfile1.

dd if=/dev/zero of=/swapfile1 bs=1024 count=104857600 && chown root:root /swapfile1 && chmod 0600 /swapfile1 && mkswap /swapfile1 && swapon /swapfile1 && echo "/swapfile1 none swap sw 0 0" >> /etc/fstab