1# create swap file
2dd if=/dev/zero of=./swapfile bs=1GB count=40
3
4# add permisions
5chmod 600 ./swapfile
6
7# format the swapfile
8mkswap ./swapfile
9
10# enable swap on swapfile
11swapon ./swapfile
12
13# check that it is enabled
14swapon --show