The Linux Newbie Guide  ⇒    Fundamentals     Advanced     Supplement   Command Index   ENG⇒中
All rights reserved, please indicate the source when citing
  

swapon - Enabling Swap






The swapon command is used to enable swap (swap space) in a Linux system.

The basic syntax of the swapon command is:
swapon OPTIONS] [DEVICE]
.Here, "DEVICE" represents the device where the swap space is located.

Some common options for the swapon command include:

Examples:

# swapon -s ← Display swap usage information
Filename                      Type        Size        Used        Priority
/dev/sda3 nbsp;               partition   1048572     0           -2
# swapon /tmp/swap-filename ←Enable a specific swap file
# swapon /dev/sdc1 ←Enable a specific swap partition

For more examples and detailed information about using swapon, please refer to the provided link.