centos 6 与centos7

永久修改主机名 :hostnamectl set-hostname leo1 #使用这种方式修改,可以永久性修改主机名称

###############################################################################################

版本 桌面系统 文件系统 内核版本 启动加载器 防火墙 默认数据库

centos6: GNOME 2.X ext4 2.6.x-x GRUB Legacy iptables MYSQL

centos7: GNOME 3.X xfs 3.10.x-x GRUB2 firewalld MariaDB

################################################################################################

版本 文件结构 主机名 时间同步

centos6: /bin /sbin /lib /lib64 在/下 /etc/sysconfig/network ntp

ntpq -p

centos7: /bin /sbin /lib /lib64 在/usr下 /etc/hostname chrony

chrony sources

################################################################################################

版本 修改时间 修改地区

centos6: vim /etc/sysconfig/clock vim /etc/sysconfig/i18n

ZONE="Asia/Tokyo"

UTC=fales /etc/sysconfig/i18n

ln -s /usr/share/zoneinfo/Asia/Tokyo /etc/localtime locale

centos7: timedatectl set-timezone Asia/Tokyo localetcl set-locale LANG=ja_JP.utf8

timedatectl status localectl status

###################################################################################################

版本 服务相关 自启动管理

centos6: sevice service_name start/stop/reload chkconfig service_name on/ off

centos7: systemctl start/stop/restart/status service_name systemctl enable/disab,eservic_name

###################################################################################################

版本 服务查看 强制停止 网络信息

centos6: chkconfig --list kill -9 <pid> netstat

netstat -I

netstat -n

centos7: systemctl list-unit-files systemctl kill --signal=9 service ip n

systemctl --type service ip -s l

ss

####################################################################################################

版本 ip地址MAC地址 路由 关闭

centos6: ifconfig -a route -n shutdown -h now

route -A inet6 -n

centos7: ip address show ip route show poweroff

ip -6 route show systemctl poweroff

####################################################################################################

版本

centos6: 重启 单用户模式 启动模式 nmtui替换了setup功能

reboot init S [GUICUI] setup

shutdown -r now vim /etc/inittab

id:3:initdefault:

[CUIGUI]

startx

centos7:reboot systemctl rescue [GUICUI] nmtui

systemctl reboot systemctl isolate multi0user.target

[CUIGUI]

systemctl isolate graphical.target

默认

systemctl set-default graphical.target

systemctl set-default multi-user.target

当前

systemctl get-default

####################################################################################################