1) 登入到伺服器執行 lsb_release -a ,即可列出所有版本資訊,例如:
[[email protected] ~]# lsb_release -a
lsb version: 1.3
distributor id: redhatenterpriseas
description: red hat enterprise linux as release 4 (nahant update 1)
release: 4
codename: nahantupdate1
[[email protected] ~]#
這個命令適用於所有的linux,包括redhat、suse、debian等發行版。
2) 登入到linux執行cat /etc/redhat-release ,例如如下:
[[email protected] ~]# cat /etc/redhat-release
red hat enterprise linux as release 4 (nahant update 1)
[[email protected] ~]#
這種方式下可以直接看到具體的版本號,比如 as4 update 1
3)登入到linux執行rpm -q redhat-release ,例如如下
[[email protected] ~]# rpm -q redhat-release
redhat-release-4as-2.4
[[email protected] ~]#
這種方式下可看到乙個所謂的release號,比如上邊的例子是2.4
這個release號和實際的版本之間存在一定的對應關係,如下:
redhat-release-3as-1 -> redhat enterprise linux as 3
redhat-release-3as-7.4 -> redhat enterprise linux as 3 update 4
redhat-release-4as-2 -> redhat enterprise linux as 4
redhat-release-4as-2.4 -> redhat enterprise linux as 4 update 1
redhat-release-4as-3 -> redhat enterprise linux as 4 update 2
redhat-release-4as-4.1 -> redhat enterprise linux as 4 update 3
redhat-release-4as-5.5 -> redhat enterprise linux as 4 update 4
注意:第(2)(3)兩種方法只對redhat linux有效
檢視linux版本的三種常用方法
1 登入到伺服器執行 lsb release a 即可列出所有版本資訊,例如 root 3.5.5biz 46 lsb release a lsb version 1.3 distributor id redhatenterpriseas description red hat enterprise...
三種檢視linux核心版本的方法
本文 我的chinaunix部落格 2010 03 02 三種檢視linux核心版本的方法,每種檢視linux核心版本結果都不一樣。root localhost uname a linux localhost.localdomain 2.6.18 128.el5 1 smp wed dec 17 1...
Linux檢視埠常用的三種用例
1 安裝telnet yum install telnet telnet server y systemctl start telnet.socket systemctl enable telnet.socket 2 用法 escape character is ctrl 退出 3 寫指令碼通過te...