CentOS 6和CentOS 7命令區別

2022-08-14 21:54:13 字數 3339 閱讀 5752

from  

(1)桌面系統

[centos6] gnome 2.x

[centos7] gnome 3.x(gnome shell)

(2)檔案系統

[centos6] ext4

[centos7] xfs

(3)核心版本

[centos6] 2.6.x-x

[centos7] 3.10.x-x

(4)啟動載入器

[centos6] grub legacy (+efibootmgr)

[centos7] grub2

(5)防火牆

[centos6] iptables

[centos7] firewalld

(6)預設資料庫

[centos6] mysql

[centos7] mariadb

(7)檔案結構

[centos6] /bin, /sbin, /lib, and /lib64在/下

[centos7] /bin, /sbin, /lib, and /lib64移到/usr下

(8)主機名

[centos6] /etc/sysconfig/network

[centos7] /etc/hostname

(9)時間同步

[centos6]

$ ntp

$ ntpq -p

[centos7]

$ chrony

$ chronyc sources

(10)修改時間

[centos6]

$ vim /etc/sysconfig/clock

zone="asia/tokyo"

utc=fales

$ sudo ln -s /usr/share/zoneinfo/asia/tokyo /etc/localtime

[centos7]

$ timedatectl set-timezone asia/tokyo

$ timedatectl status

(11)修改地區

[centos6]

$ vim /etc/sysconfig/i18n

lang="ja_jp.utf8"

$ /etc/sysconfig/i18n

$ locale

[centos7]

$ localectl set-locale lang=ja_jp.utf8

$ localectl status

(12)服務相關

1)啟動停止

[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

[centos7]

$ systemctl kill --signal=9 sshd

(13)網路

1)網路資訊

[centos6]

$ netstat

$ netstat -i

$ netstat -n

[centos7]

$ ip n

$ ip -s l

$ ss

2)ip位址mac位址

[centos6]

$ ifconfig -a

[centos7]

$ ip address show

3)路由

[centos6]

$ route -n

$ route -a inet6 -n

[centos7]

$ ip route show

$ ip -6 route show

(14)重啟關閉

1)關閉

[centos6]

$ shutdown -h now 

[centos7]

$ poweroff

$ systemctl poweroff

2)重啟

[centos6]

$ reboot

$ shutdown -r now

[centos7]

$ reboot

$ systemctl reboot

3)單使用者模式

[centos6]

$ init s

[centos7]

$ systemctl rescue

4)啟動模式

[centos6]

[guicui]

$ vim /etc/inittab

id:3:initdefault:

[cuigui]

$ startx

[centos7]

[guicui]

$ systemctl isolate multi-user.target

[cuigui]

$systemctl isolate graphical.target

預設$ systemctl set-default graphical.target

$ systemctl set-default multi-user.target

當前$ systemctl get-default

CentOS7和CentOS6的區別

centos6 ext4 centos7 xfs 說明 fdisk等磁碟操作命令使用都一樣,只是格式化磁碟時使用mkfs.xfs而不要用mkfs.ext4,ext4的檔案系統在centos7上只能讀不能寫。centos6 etc sysconfig network修改hostname的值 cento...

如何區別centos6和centos7

開機自檢,硬體自檢 mbr磁碟分割槽是一種使用最為廣泛的分割槽結構,它也被稱為dos分割槽結構,但它並不僅僅應用於 windows系統平台,也應用於linux,基於x86的unix等系統平台。它位於磁碟的0號扇區 一扇 區等於512位元組 是乙個重要的扇區 簡稱mbr扇區 1 mbr只支援2tb的硬...

Centos 6和Centos 7的區別

cat etc redhat release 檢視系統版本 1.檢視核心版本 uname a centos6.x uname r centos7.x 2.啟動載入器 centos6 grub legacy efibootmgr centos7 grub2 3.防火牆 iptables centos6...