swapoff

Close the specified swap space

Supplementary instructions

swapoff command is used to close the specified swap space (including swap files and swap partitions). Swapoff is actually a symbolic link to swapon, which can be used to close the system's swap area.

grammar

swapoff(option)(parameter)

Options

-a: Close all swap spaces in the configuration file "/etc/fstab".

Parameters

Swap space: Specify the swap space that needs to be activated, which can be a swap file or a swap partition. If it is a swap partition, specify the device file corresponding to the swap partition.

Example

Close swap partition

swapoff /dev/sda2