美文网首页
2022-06-07 centos环境初始化

2022-06-07 centos环境初始化

作者: anyangdp | 来源:发表于2022-06-07 13:47 被阅读0次

同步时间

# 安装软件
yum -y install ntpdate 

# 向阿里云服务器同步时间
ntpdate time1.aliyun.com

# 删除本地时间并设置时区为上海
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

# 查看时间
date -R || date

命令补全

# 安装bash-completion
yum -y install bash-completion bash-completion-extras

# 使用bash-completion
source /etc/profile.d/bash_completion.sh

关闭swap分区

# 临时关闭:
swapoff -a 

#永久关闭:
vi /etc/fstab 

# 将文件中的/dev/mapper/centos-swap这行代码注释掉
#/dev/mapper/centos-swap swap  swap    defaults        0 0

# 确认swap已经关闭:若swap行都显示 0 则表示关闭成功 
free -m

相关文章

网友评论

      本文标题:2022-06-07 centos环境初始化

      本文链接:https://www.haomeiwen.com/subject/wnlemrtx.html