Disk and Storage

swapoff

Disables swap devices or files.

swapoff turns off swap space and moves pages back to RAM if possible.

Syntax
swapoff 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

Disable one swap file
sudo swapoff /swapfile

Stops using that swap file.

Disable all swap
sudo swapoff -a

Disables all swap entries.

swapoff Command
FieldDetails
Commandswapoff
CategoryDisk and Storage
Primary useDisables swap devices or files.
Syntaxswapoff device-or-file