Create a swap file

Create a 2G swap file, set permissions, format it and turn it on.

fallocate -l 2G /swapfile && chmod 600 /swapfile && mkswap /swapfile && swapon /swapfile

tool
linux133 commands
tags
linuxdiskmemory

More linux commands

  • swapon --show && free -h

    List active swap areas and overall memory and swap usage.

  • ip -br a

    Show a short list of all interfaces and their IPs.

  • ip route show table all

    Show routes from all tables, including policy routing tables.

  • ip route add 10.0.0.0/8 via 192.168.1.1 dev eth0

    Add a static route. It is gone after a reboot.

  • ip neigh show

    Show the neighbour (ARP/NDP) cache with the reachability state of each entry.

all 133 linux commands