如何查看linux发行版 distro 的版本:hostnamectl, os-release, centos, lsb_release, screenfetch, neofetch

Linux generic

uname -a

uname -s -r

1
2
# Check kernel compile time 
uname -v

安装了 systemd

1
hostnamectl

安装了 lsb

  • centos

    1
    2
    3
      yum install redhat-lsb
    
      lsb_release -a
    

centos / redhat

cat /etc/redhat-release

cat /etc/centos-release

cat /etc/system-release

  • centos-release 包里面有哪些版本信息文件
1
2
3
4
5
rpm -ql centos-release | grep release$

# or

rpm -qf /etc/redhat-release