岁月绵长,人间静好

Hey guys, Here is GouGui's Blog !

CentOS 6和CentOS 7常用命令区别总结

由于韩国某些不可描述的行为,于是将博客迁移到了日本,采用最新正式版本软件搭建了lnmp服务器环境,发现centos7很多常用命令和centos6区别较大,故简单总结下。

1、防火墙
[CentOS6] iptables
[CentOS7] firewalld

目前已禁用firewalld,启用了iptables

2、主机名
[CentOS6] /etc/sysconfig/network
[CentOS7] /etc/hostname

3、服务相关

启动停止
[CentOS6]
service service_name start
service service_name stop
service sshd restart/status/reload

[CentOS7]
systemctl start service_name
systemctl stop service_name
systemctl restart/status/reload sshd

自启动
[CentOS6]
chkconfig service_name on/off

[CentOS7]
systemctl enable service_name
systemctl disable service_name

服务一览
[CentOS6]
chkconfig –list

[CentOS7]
systemctl list-unit-files
systemctl –type service

强制停止
[CentOS6]
kill -9 <PID>

[CentOS7]
systemctl kill –signal=9 sshd

点赞

发表评论

邮箱地址不会被公开。 必填项已用*标注