前言
以下是一些CentOS 6.5和CentOS 7中常用的命令对照表。请注意,这只是一个简要的对比,实际使用中可能会有一些细微的差异。
启动、停止和重启服务:
CentOS 6.5:
service serviceName start/stop/restart
CentOS 7:
systemctl start/stop/restart serviceName
查看服务状态:
CentOS 6.5:
service serviceName status
CentOS 7:
systemctl status serviceName
防火墙管理:
CentOS 6.5:
service iptables start/stop/restart
CentOS 7:
systemctl start/stop/restart firewalld
查看网络信息:
CentOS 6.5:
ifconfig
CentOS 7:
ip addr show
查看系统日志:
CentOS 6.5:
tail /var/log/messages
CentOS 7:
journalctl
查看内存和CPU信息:
CentOS 6.5:
free -m
CentOS 7:
free -h
管理用户和组:
CentOS 6.5:
useradd username
CentOS 7:
adduser username
服务启动设置:
CentOS 6.5:
chkconfig serviceName on/off
CentOS 7:
systemctl enable/disable serviceName
系统时间同步:
CentOS 6.5:
service ntpd start/stop/restart
CentOS 7:
systemctl start/stop/restart chronyd