首页 > 系统服务 > 详细

SHELL小知识SHELL小知识SHELL小知识SHELL小知识SHELL小知识SHELL小知识

时间:2021-04-14 16:07:11      阅读:30      评论:0      收藏:0      [点我收藏+]
1. #此处1表示原文件的最后一行;-i.bak会将源文件变成fstab.bak
[root@k8s-master ~]# more /etc/fstab

#
# /etc/fstab
# Created by anaconda on Tue Apr  6 16:56:57 2021
#
# Accessible filesystems, by reference, are maintained under /dev/disk
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/centos-root /                       xfs     defaults        0 0
UUID=dc059168-52c0-4287-b877-1385b235bebc /boot                   xfs     defaults        0 0
/dev/mapper/centos-home /home                   xfs     defaults        0 0
/dev/mapper/centos-swap swap                    swap    defaults        0 0

[root@k8s-master ~]# 
[root@k8s-master ~]# sed -i.bak  ‘/swap/ s/^\(.*\)$/#\1/g‘ /etc/fstab 
[root@k8s-master ~]# more /etc/fstab

#
# /etc/fstab
# Created by anaconda on Tue Apr  6 16:56:57 2021
#
# Accessible filesystems, by reference, are maintained under /dev/disk
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/centos-root /                       xfs     defaults        0 0
UUID=dc059168-52c0-4287-b877-1385b235bebc /boot                   xfs     defaults        0 0
/dev/mapper/centos-home /home                   xfs     defaults        0 0
#/dev/mapper/centos-swap swap                    swap    defaults        0 0

[root@k8s-master ~]# 

 

SHELL小知识SHELL小知识SHELL小知识SHELL小知识SHELL小知识SHELL小知识

原文:https://www.cnblogs.com/vmsysjack/p/14657334.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!