Linux command
swapoff 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Disable
sudo swapoff /path/to/swapfile
Example
sudo swapoff -a
Example
sudo swapoff -L swap_label
Example
sudo swapoff -U uuid
说明
swapoff disables swapping on the specified devices and files. When swapoff is called, all pages that are swapped to the specified areas are swapped back into RAM before the swap area is disabled.
参数
- -a, --all
- Disable all swap areas listed in /proc/swaps
- -L label
- Disable swap partition with the specified label
- -U uuid
- Disable swap partition with the specified UUID
- -v, --verbose
- Enable verbose output
- -h, --help
- Display help text and exit
- -V, --version
- Display version information and exit
FAQ
What is the swapoff command used for?
swapoff disables swapping on the specified devices and files. When swapoff is called, all pages that are swapped to the specified areas are swapped back into RAM before the swap area is disabled.
How do I run a basic swapoff example?
Run `sudo swapoff /path/to/swapfile` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -a, --all do in swapoff?
Disable all swap areas listed in /proc/swaps