CentOS的新变化

1、service -> systemctl命令
systemctl命令是系统服务管理器指令,它实际上将 service 和 chkconfig 这两个命令组合到一起。

CentOS 6 service命令与CentOS 7 systemctl 命令
以httpd 为例:
任务 旧指令  新指令
---------------------------------------------------------------------------------------------------------------------------------------------
使某服务自动启动 chkconfig --level 3 httpd onsystemctl enable httpd.service
使某服务不自动启动     chkconfig --level 3 httpd offsystemctl disable httpd.service
检查服务状态 service httpd statussystemctl status httpd.service (服务详细信息) systemctl is-active httpd.service (仅显示是否 Active)
显示所有已启动的服务 chkconfig --listsystemctl list-units --type=service
启动某服务         service httpd startsystemctl start httpd.service
停止某服务         service httpd stopsystemctl stop httpd.service
重启某服务         service httpd restartsystemctl restart httpd.service

2、ifconfig -> ip 命令
CentOS 7最小化系统,使用“ipaddr”和“ip link”命令来查找网卡详情。要知道统计数据,可以使用“ip -s link”
3、netstat -> ss命令
ss命令用来显示处于活动状态的套接字信息。ss命令可以用来获取socket统计信息,它可以显示和netstat类似的内容。但ss的优势在于它能够显示更多更详细的有关TCP和连接状态的信息,而且比netstat更快速更高效。
4、route -> ip route命令
5、iptables -> firewall-cmd命令
Centos7的网络防火墙命令由 iptables 改成 firewall-cmd 
服务启动/停止/自启/去掉自启:systemctl status/start/stop/enable/disable firewalld
centos7中默认开启防火墙,如果有新的服务需要加入端口或者关闭防火墙:
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --reload
---------------------
作者:一夜长风
来源:CSDN
原文:https://blog.csdn.net/wlzx120/article/details/78269133
版权声明:本文为博主原创文章,转载请附上博文链接!

猜你喜欢

转载自www.cnblogs.com/wlzx/p/10232608.html
今日推荐