您也可以尝试/etc/redhat-release
或/etc/fedora-release
:
cat /etc/fedora-release Fedora release 7 (Moonshine)
`cat/etc/redhat-release`也适用于我,但更好的是`cat/etc/os-release`,它真正提供了详细信息. (14认同)
myroslav.. 47
建议的标准文件是/etc/os-release
.见http://www.freedesktop.org/software/systemd/man/os-release.html
您可以执行以下操作:
$ source /etc/os-release $ echo $ID fedora $ echo $VERSION_ID 17 $ echo $VERSION 17 (Beefy Miracle)
stephen mulc.. 20
你可以试试
lsb_release -a
它至少适用于Debian和Ubuntu(因为它是LSB,它至少应该是大多数其他主流发行版).http://rpmfind.net/linux/RPM/sourceforge/l/ls/lsb/lsb_release-1.0-1.i386.html表明它已经存在了很长一段时间.
cat /etc/issue
或者 cat /etc/fedora-release
按照@Bruce ONeel的建议
您也可以尝试/etc/redhat-release
或/etc/fedora-release
:
cat /etc/fedora-release Fedora release 7 (Moonshine)
建议的标准文件是/etc/os-release
.见http://www.freedesktop.org/software/systemd/man/os-release.html
您可以执行以下操作:
$ source /etc/os-release $ echo $ID fedora $ echo $VERSION_ID 17 $ echo $VERSION 17 (Beefy Miracle)
你可以试试
lsb_release -a
它至少适用于Debian和Ubuntu(因为它是LSB,它至少应该是大多数其他主流发行版).http://rpmfind.net/linux/RPM/sourceforge/l/ls/lsb/lsb_release-1.0-1.i386.html表明它已经存在了很长一段时间.
最简单的命令可以提供您所需要的,但其他一些好的信息也是:
hostnamectl
cat /etc/*release
它几乎适用于任何主要发行版.
[Belmiro@HP-550 ~]$ uname -a Linux HP-550 2.6.30.10-105.2.23.fc11.x86_64 #1 SMP Thu Feb 11 07:06:34 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux [Belmiro@HP-550 ~]$ lsb_release -a LSB Version: :core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:deskt op-3.1-amd64:desktop-3.1-noarch:desktop-3.2-amd64:desktop-3.2-noarch Distributor ID: Fedora Description: Fedora release 11 (Leonidas) Release: 11 Codename: Leonidas [Belmiro@HP-550 ~]$
那uname -a
呢