应用场景
很多人在使用了CentOS 6以后,跳转到CentOS 7系统,发现命令不一致,倒是使用很不方便,容易混淆,这里列举一下两个版本的一些差别,方便大家在使用的过程中进行注意。
1. ifconfig,route
CentOS 6.x
系统自带,可以直接使用
CentOS 7.x
执行yum install net-tools
2. ntpd,ntpdate
执行yum install ntpd ntpdate
3. 参看版本号
cat /etc/redhat-release
4. 服务管理
chkconfig /etc/init.d/服务
systemctl
5. Python版本
2.6
2.7
6. 网卡
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/sysconfig/network-scripts/ifcfg-**** #自己的命名规则
7. 文件系统
ext4
xfs
8. 防火墙
iptables
firewalld
9. 操作服务
service 服务名 start/stop/restart
systemctl start/stop/restart 服务名.service