System and processes
The swapoff command
Disables swap memory, returning its contents to RAM.
Syntax
swapoff DISPOSITIVOMost useful options
-aDisables all swapCopy-ready examples
$ sudo swapoff /dev/sda2Disable the swapYou can try them in the browser terminal: it does not touch your computer.
Typical mistakes
- If RAM is full, disabling swap can slow down or freeze the system.
FAQ
When to disable swap?
To repair the partition or before resizing it.
Learn to actually use it
The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.
Start the free course