centOS6 和 centOS 7 的区别

查看linux 系统版本
linux 系统版本

主要用一下命令

cat /etc/redhat-release

1.运行级别runlevel 的不同
centos6 “/etc/inittab” 在centos7中是无效的。

centos7 system target 替代 了inittab

##永久生效下次登录生效
systemctl get-default graphical.target 切换到5
systemctl get-default multi-user.target 切换到3
##临时生效的话 
init3


#查看运行级别
ls -lh /usr/lib/systemd/system/runlevel*.target

运行级别对应关系

    init level           systemctl target
    0                      shutdown.target
    1                      emergency.target
    2                      rescure.target
    3                      multi-user.target
    4                      无
    5                      graphical.target
    6                      无
0 停机
1 单用户,Does not configure network interfaces, start daemons, or allow non-root logins
2 多用户,无网络连接 Does not configure network interfaces or start daemons
3 多用户,启动网络连接 Starts the system normally.
4 用户自定义
5 多用户带图形界面
6 重启

2.查看防火墙状态

centOS6
查看防火墙状态
service iptables status
关闭防火墙
service iptables stop
开启防火墙
service iptables start

centOs7 
查看防火墙状态
systemctl status firewalld
关闭防火墙
systemctl stop firewalld
开启防火墙
systemctl start firewalld

3.服务存放的位置不同,

centOS6 
/etc/init.d/

centOS7
/usr/lib/systemd/system

4 查看服务的命令

centOS6  
 chkconfig  --list  | grep xxx
centOS7
 systemctl list-unit-files | grep xxx
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值