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 on this site, held on your device. The app adds 632 more: 1,510 commands and 120 fix flows, searchable with no connection. Free to install, no ads (some content is a one-time purchase).

Get it free on the App Store