Linux swapon command

Linux 命令大全Linux Command Reference

The Linux swapon command is used to activate swap space in the Linux system. Linux system memory management must use a swap area to create virtual memory.

Syntax

/sbin/swapon -a [-v]
/sbin/swapon [-v] [-p priority] specialfile ...
/sbin/swapon [-s]

Parameter description:

  • -h Show help
  • -V Display version information
  • -s Display brief device information
  • -a Automatically start all swap devices
  • -p Set priority. You can choose a number between 0 and 32767 for it. Or add pri=[value] in /etc/fstab ([value] is a number between 0 and 32767), and then you can conveniently directly use swapon -a to start them, and they will have priority settings.

swapon is to enable swap.

Conversely, there is a command to disable swap, swapoff.

Linux 命令大全Linux Command Reference

Other Extensions