良许Linux教程网 Linux命令大全 Linux常用命令swapoff命令具体使用方法

Linux常用命令swapoff命令具体使用方法

Linux常用命令swapoff命令用于关闭系统交换区(swap area),swapoff实际上为swapon的符号连接,可用来关闭系统的交换区,下面良许教程网为大家分享一下Linux常用命令swapoff命令具体使用方法。

Linux常用命令swapoff命令具体使用方法

语法

swapoff [设备]

参数:

  • -a 将/etc/fstab文件中所有设置为swap的设备关闭

  • -h 帮助信息

  • -V 版本信息

实例

显示分区信息:

# sfdisk -l //显示分区信息

Disk /dev/sda: 1305 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

 Device Boot Start   End  #cyls  #blocks  Id System
/dev/sda1  *   0+   12   13-  104391  83 Linux
/dev/sda2     13  1304  1292  10377990  8e Linux LVM
/dev/sda3     0    -    0     0  0 Empty
/dev/sda4     0    -    0     0  0 Empty

Disk /dev/sdb: 652 cylinders, 255 heads, 63 sectors/track

sfdisk: ERROR: sector 0 does not have an msdos signature
/dev/sdb: unrecognized partition
No partitions found

关闭交换分区。

# swapoff /dev/sda2 // 关闭交换分区

至此关于Linux常用命令swapoff命令的使用方法分享结束,大家如果对swapoff命令的使用方法还有问题可以通过评论区将问题提交我们。

以上就是良许教程网为各位朋友分享的Linux系统相关内容。想要了解更多Linux相关知识记得关注公众号“良许Linux”,或扫描下方二维码进行关注,更多干货等着你 !

img

本文由 良许Linux教程网 发布,可自由转载、引用,但需署名作者且注明文章出处。如转载至微信公众号,请在文末添加作者公众号二维码。
良许

作者: 良许

良许,世界500强企业Linux开发工程师,公众号【良许Linux】的作者,全网拥有超30W粉丝。个人标签:创业者,CSDN学院讲师,副业达人,流量玩家,摄影爱好者。
上一篇
下一篇

发表评论

联系我们

联系我们

公众号:良许Linux

在线咨询: QQ交谈

邮箱: yychuyu@163.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部