JAEN

Linux

swapon / swapoff

CautionManage swap

swapon --show

Shows and enables swap. The emergency RAM-pressure fix: create a swap file, mkswap, swapon.

Examples

  • fallocate -l 2G /swapfile && chmod 600 /swapfile && mkswap /swapfile && swapon /swapfileAdd a 2 GB swap file

Syntax

swapon --show / swapon <dev|file> / mkswap <dev|file>

Before you run it

swapoff can hang under memory pressure.

Related commands

The same reference, with no signal at all

Every command and flow from this site, held on your device and searchable with no connection. Free to install, no ads.

Get it free on the App Store