如何判断linux是哪种发行版

shaovey 2009-05-21 09:46:16
linux下有什么办法判断,当前使用的linux是什么发行版呢?比如如何区分Debian;Slackware...
uname -a 也看不出来啊。
...全文
640 24 打赏 收藏 转发到动态 举报
写回复
用AI写文章
24 条回复
切换为时间正序
请发表友善的回复…
发表回复
linuxboy_1 2010-10-13
  • 打赏
  • 举报
回复
系统启动的时候就看到了
HellPhantom 2010-01-19
  • 打赏
  • 举报
回复
[Quote=引用 22 楼 shaovey 的回复:]
谢谢各位的解答!

more /etc/redhat-release
cat /etc/issue
cat /proc/version
等等命令不能在各个Linux版本之间通用,我使用Slackware和Debian验证过。

这个方法是可以通用的:
ls /etc/*_version
在不同的linux发行版中都有类似文件,Debian中的为/etc/debian_version,Slackware中的为/etc/slackware_version
[/Quote]


请您注意,可见您的测试环境一般,测试目标较少. 您所谓的这个可以通用的方式 在 CentOS中,是不能用的,CentOS中 只能使用那3种方法,连lsb_release都不能用
shaovey 2009-06-16
  • 打赏
  • 举报
回复
谢谢各位的解答!

more /etc/redhat-release
cat /etc/issue
cat /proc/version
等等命令不能在各个Linux版本之间通用,我使用Slackware和Debian验证过。

这个方法是可以通用的:
ls /etc/*_version
在不同的linux发行版中都有类似文件,Debian中的为/etc/debian_version,Slackware中的为/etc/slackware_version
linuxboy_1 2009-05-28
  • 打赏
  • 举报
回复
cat /etc/issue
  • 打赏
  • 举报
回复
无语了....
unixlinuxsys 2009-05-28
  • 打赏
  • 举报
回复
[Quote=引用楼主 shaovey 的帖子:]
linux下有什么办法判断,当前使用的linux是什么发行版呢?比如如何区分Debian;Slackware...
uname -a 也看不出来啊。
[/Quote]


[root@localhost /]# more /etc/redhat-release
CentOS release 5.3 (Final)
[root@localhost /]#


[root@localhost /]# cat /proc/version
Linux version 2.6.18-128.1.10.el5 (mockbuild@builder16.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)) #1 SMP Thu May 7 10:39:21 EDT 2009
[root@localhost /]#


[root@localhost /]# more /etc/issue
CentOS release 5.3 (Final)
Kernel \r on an \m

[root@localhost /]#



[root@localhost /]# lsb_release -d
Description: CentOS release 5.3 (Final)
[root@localhost /]#

once_and_again 2009-05-27
  • 打赏
  • 举报
回复

cat /etc/issue



issue美音:['ɪʃju]英音:['iʃju:]
issue的中文翻译
以下结果由译典通提供词典解释
及物动词 vt.
1.
发行;发布
The post office issued the stamps last week.
上星期邮局发行了这些邮票。
2.
发给,配给[O][(+to)],核发
Who issued the travel documents?
谁核发这些旅游证件的?
3.
使流出,放出,排出

不及物动词 vi.
1.
出来[(+forth)]
2.
流出[(+from)]
Lava issued from the volcano.
熔岩从火山口流出来。
3.
由...得出,由...产生[(+from)]
A strange noise issues from the next room.
隔壁房间里传出奇怪的响声。
4.
诞生,传代
His difficulties issue from his lack of knowledge.
他遇到的困难是由缺少知识造成的。
5.
收益,生息
6.
发行,颁布,出版
A new coinage issued.
一种新硬币发行了。

名词 n.
1.
问题;争论;争议[C]
They have published a lot of new books on international issues.
他们已经出版了很多论述国际问题的新书。
2.
发行(物);一次发行量;(报刊)期号[C]
There's an article about Jamaica in this issue.
在这一期里有一篇关于牙买加的文章。
3.
流出;流出物[U]
4.
【律】子女,子嗣[U]
He died without issue.
他身后无子女。
5.
(土地,地产等的)收益[P]
puheavy123 2009-05-27
  • 打赏
  • 举报
回复
[Quote=引用 16 楼 21bird 的回复:]
来晚了……同楼上……
[/Quote]

高手。。。。
某鸟 2009-05-26
  • 打赏
  • 举报
回复
来晚了……同楼上……
bitmanzhou 2009-05-22
  • 打赏
  • 举报
回复
如果是新的发行版,可以用:

[bitman@feb ~]$ lsb_release --help
FSG lsb_release v2.0 prints certain LSB (Linux Standard Base) and
Distribution information.

Usage: lsb_release [OPTION]...
With no OPTION specified defaults to -v.

Options:
-v, --version
Display the version of the LSB specification against which the distribution is compliant.
-i, --id
Display the string id of the distributor.
-d, --description
Display the single line text description of the distribution.
-r, --release
Display the release number of the distribution.
-c, --codename
Display the codename according to the distribution release.
-a, --all
Display all of the above information.
-s, --short
Use short output format for information requested by other options (or version if none).
-h, --help
Display this message.
[bitman@feb ~]$ lsb_release -d
Description: Red Hat Enterprise Linux Server release 5 (Tikanga)
shaovey 2009-05-22
  • 打赏
  • 举报
回复
但是Debian和Slackware下都没有*release这类文件.
大家还是使用ls /etc/*version吧
shaovey 2009-05-22
  • 打赏
  • 举报
回复
已经找到一个方法:
ls /etc/*_version
在不同的linux发行版中都有类似文件,Debian中的为/etc/debian_version,Slackware中的为/etc/slackware_version
或者使用
ls /etc/*_release
效果相同。
y88182472 2009-05-22
  • 打赏
  • 举报
回复

[frank@www mnt]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5 (Tikanga)
[frank@www mnt]$
shaovey 2009-05-22
  • 打赏
  • 举报
回复
接手别人的安装好的系统,才会出现这类需求。在对不同版本linux发行版不熟悉的情况下,这个命令还是挺好用的。
cat /etc/redhat-release,这个命令不是通用命令吧?Debian、Slackware上都没有。
cat /etc/issue,在Debian上好用,在Slackware上显示Welcome to \s \r (\l)。
cat /proc/version,效果和uname类似,看不出是什么系统。
中国168 2009-05-22
  • 打赏
  • 举报
回复
用 cat /proc/version 看看
wshwqh2000 2009-05-22
  • 打赏
  • 举报
回复
cat /etc/issue

居然显示:welcome to \s \r (\l)
显示不出来版本!
独孤过儿 2009-05-22
  • 打赏
  • 举报
回复
感觉这个没什么意义,难道你连自己装的什么系统都不知道吗?

而且即使是一个陌生的机器,随便上去看几个目录的结构也能判断出来是哪个版本linux了啊

puheavy123 2009-05-22
  • 打赏
  • 举报
回复
但是/etc/issue是可以用户定义的,而
[root@RHEL4_U5 icons]# cat /etc/redhat-release
Red Hat Enterprise Linux ES release 4 (Nahant Update 5)

是系统定义的哦,oracle安装都是检测这个文件的内容的,如果检测到内容不符合oracle的安装需求,就退出安装
bzcnc 2009-05-21
  • 打赏
  • 举报
回复
学习中
morris88 2009-05-21
  • 打赏
  • 举报
回复
# cat /etc/issue
加载更多回复(4)

19,613

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧