【Linux】CentOS 6 相较于 CentOS 7的变化

【1】防火墙

[CentOS 6]:iptables
命令:
service iptables start/stop/restart

[CentOS 7]:firewalld
命令:
systemctl start/stop/restart firewalld

【2】IP地址

[CentOS 6]:ifconfig

[CentOS 7]:ifconifg / ip address show

配置静态IP地址
vim /etc/sysconfig/network-scripts/ifcfg-ens33

bootproto=static
onboot=yes
IPADDR=192.168.100.100
NETMASK=255.255.255.0
GATEWAY=192.168.100.2
DNS1=8.8.8.8
DNS2=119.29.29.29

【3】主机名

[CentOS 6]:/etc/sysconfig/network

[CentOS 7]:/etc/hostname

【4】命令行和界面的相互转换

[CentOS 7]
systemctl get-default	获取当前模式
systemctl set-default graphical.target	修改为图形界面
systemctl set-default multi-user.target	修改启动为命令行模式
reboot	重新启动

【5】查看系统服务信息

[CentOS 6] chkconfig

[CentOS 7] systemctl list-unit-files

【6】开启 启动/关闭

[CentOS 6] chkconfig service_name on/off

[CentOS 7] systemctl enable/disable service_name / chkconfig service_name on/off

【7】后台进程

[CentOS6] netstat

[CentOS7] ss

总结

服务进程通用操作:systemctl + 操作 + 服务

猜你喜欢

转载自blog.csdn.net/qq_43733123/article/details/106822467