什么命令会告诉我我正在运行什么版本的 Ubuntu?

the*_*ere 3 linux linux-distributions ubuntu

我正在寻找一个 Unix/Linux 命令来确定我正在运行的发行版的哪个版本。

具体来说,我希望能够区分 Ubuntu 9.04 和 9.10。

我在想一些类似的东西uname -a,但这没有用。

Ubuntu 9.04 提供:

Linux myhost 2.6.28-17-generic #58-Ubuntu SMP Tue Dec 1 21:27:25 UTC 2009 x86_64 GNU/Linux
Run Code Online (Sandbox Code Playgroud)

Ubuntu 9.10 提供:

Linux myhost 2.6.31-17-generic #54-Ubuntu SMP Thu Dec 10 17:01:44 UTC 2009 x86_64 GNU/Linux
Run Code Online (Sandbox Code Playgroud)

有什么建议?

Ric*_*ams 6

你可以用这个,

cat /etc/issue
Run Code Online (Sandbox Code Playgroud)

或这个,

cat /etc/lsb-release
Run Code Online (Sandbox Code Playgroud)

后者可能更好,因为它也给出了诸如“karmic”之类的发布名称。但我猜这取决于你使用它的目的。


Sat*_*hat 5

lsb_release 还显示版本:

$ lsb_release -a 
Run Code Online (Sandbox Code Playgroud)

没有可用的 LSB 模块。

分销商 ID: Ubuntu

描述:Ubuntu feisty(开发分支)

版本:7.04

代号:活泼