zoukankan      html  css  js  c++  java
  • centos7 命令 对比 cenots6 命令

    1)  列出所有service开机启动项

    centos 7 

    systemctl list-unit-files |grep enabled

    centos 6

     chkconfig --list|grep on

    2) 切换运行级别

    centos 7 

    #切换去多用户命令行模式
    systemctl set-default multi-user.target
    #切换去图形模式
    systemctl set-default graphical.target
    #查看有哪些级别
    systemctl list-units --type=target

    centos 6

    #用命令runlevel查看当前的运行级别
    init 3 #切换去多用户命令行模式(无图形,服务器模式)
    init 5 #切换去图形界面模式

    3)设置开机启动

    centos 7

    systemctl disable firewalld.service #禁止开启启动
    systemctl enable firewalld.service #开启开机启动

    centos 6

    chkconfig iptables on #设置开启启动
    chkconfig iptables off #取消开机启动

    4)修改主机名

    centos 7

    hostnamectl set-hostname www_001

    centos 6

    修改/etc/sysconfig/network
    修改/etc/hosts
    hostname newhostname //临时生效,即时生效
    永久生效需要重启服务器
  • 相关阅读:
    常建的性能指标
    性能测试常见分类
    性能测试相关概念和指标
    adb命令熟悉
    打包ajax生成小工具
    深入理解类加载demo
    设计模式七大原则
    javamail邮件实现
    @RequiredArgsConstructor用法
    spring-security查询数据库源码解析
  • 原文地址:https://www.cnblogs.com/faberbeta/p/centos7001.html
Copyright © 2011-2022 走看看