新需求
- 我要改主机名,同步时间,查看磁盘空间......;
知识点
- 总结了下之前没有讲到的平时又需要用的命令;
上手操作
#更改主机名
hostnamectl set-hostname test.server
#同步时间
systemctl restart chronyd
#创建软连接
ln -s /usr/local/mysql.. /usr/local/mysql
# 创建用户
useradd test
#修改目录或文件权限
chmod -R 755 test.log
#修改用户、用户组
chown -R mysql.mysql test.log
#查看磁盘空间
df -h
lsblk
#查看centos版本
cat /etc/redhat-release
#重启server
shutdown -r now
#查看网络
ip a
ifconfig
#查看端口情况
ss -lnt
netstatus -lntup
#查看程序进程
ps -ef|grep sshd
#查看系统process的状态
top
#查看历史命令
history
课程视屏
centos_base_lesson11 on bilibili
centos_base_lesson11 on xigua