Disk and Storage

swapon

Enables swap devices or files.

swapon activates swap space so the kernel can use it for memory pressure relief.

Syntax
swapon [options] device-or-file

Arguments explained

  • Options adjust output or behavior.
  • Arguments name the files, services, hosts, or values the command should work with.

Common examples

Show active swap
swapon --show

Lists enabled swap devices and files.

Enable a swap file
sudo swapon /swapfile

Activates a prepared swap file.

swapon Command
FieldDetails
Commandswapon
CategoryDisk and Storage
Primary useEnables swap devices or files.
Syntaxswapon [options] device-or-file