linux 内核名称,找出Linux的名称,版本以及内核详细

This short tutorial is intended to help newbies who don’t know how to find out the Linux distribution name, version and kernel details via command line.

Method 1 �C Distribution & Version Details

Command:

cat /etc/*-release

Sample Output On CentOS 6.4:

CentOS release 6.4 (Final)

Sample Output On Ubuntu 13.04:

DISTRIB_ID=UbuntuDISTRIB_RELEASE=13.04DISTRIB_CODENAME=raringDISTRIB_DESCRIPTION="Ubuntu 13.04"NAME="Ubuntu"VERSION="13.04, Raring Ringtail"ID=ubuntuID_LIKE=debianPRETTY_NAME="Ubuntu 13.04"VERSION_ID="13.04"HOME_URL="http://www.ubuntu.com/"SUPPORT_URL="http://help.ubuntu.com/"BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"

Sample Output On Debian 7:

PRETTY_NAME="Debian GNU/Linux 7 (wheezy)"NAME="Debian GNU/Linux"VERSION_ID="7"VERSION="7 (wheezy)"ID=debianANSI_COLOR="1;31"HOME_URL="http://www.debian.org/"SUPPORT_URL="http://www.debian.org/support/"BUG_REPORT_URL="http://bugs.debian.org/"

Method 2 �C      Distribution & Version Details

Command:

lsb_release -a

Sample Output On Debian 7:

No LSB modules are available.

Distributor ID:    Debian

Description:    Debian GNU/Linux 7.1 (wheezy)

Release:    7.1

Codename:    wheezy

Sample Output On Ubuntu 13.04:

No LSB modules are available.

Distributor ID:    Ubuntu

Description:    Ubuntu 13.04

Release:    13.04

Codename:    raring

Method 3 �C Finding Kernel Version

Command:

cat /proc/version

Sample Output On CentOS 6.4:

Linux version 2.6.32-358.11.1.el6.centos.plus.i686 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) ) #1 SMP Wed Jun 12 17:07:23 UTC 2013

Sample Output On Debian 7:

Linux version 3.2.0-4-486 (debian-kernel@lists.debian.org) (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 Debian 3.2.46-1

Sample Output On Ubuntu 13.04:

Linux version 3.8.0-29-generic (buildd@roseapple) (gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1) ) #42-Ubuntu SMP Tue Aug 13 19:40:39 UTC 2013

Method 4 �C Finding Kernel Version

Command:

uname -a

Sample Output On CentOS 6.4:

Linux server.unixmen.com 2.6.32-358.11.1.el6.centos.plus.i686 #1 SMP Wed Jun 12 17:07:23 UTC 2013 i686 i686 i386 GNU/Linuxm

Sample output On Debian 7:

Linux server 3.2.0-4-486 #1 Debian 3.2.46-1 i686 GNU/Linux

Sample Output On Ubuntu 13.04:

Linux sk 3.8.0-29-generic #42-Ubuntu SMP Tue Aug 13 19:40:39 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Method 5 �C Finding Distribution Name

Command:

cat /etc/redhat-release

Sample Output On CentOS 6.4/RHEL 6.4:

CentOS release 6.4 (Final)

Method 6 �C Finding Distribution version

Command:

cat /etc/debian_version

Sample Output On Debian 7:

7.1

Sample Output On Ubuntu 13.04:

wheezy/sid

Method 7 �C Finding Distribution name & Version

Command:

cat /etc/issue

Sample Output On Ubuntu 13.04:

Ubuntu 13.04 \n \l

Sample Output On Debian 7:

Debian GNU/Linux 7 \n \l

Sample Output On CentOS 6.4:

CentOS release 6.4 (Final)

Kernel \r on an \m

For other distributons

I didn’t not check the following commands yet, because i don’t have the respective systems at the time writing this. I gathered these details on various websites. Hope it helps you.

Novel SUSE:

cat /etc/SuSE-release

Fedora:

cat /etc/fedora-release

Slackware:

cat /etc/slackware-release

cat /etc/slackware-version

Mandrake:

cat /etc/mandrake-release

Yellow dog:

cat /etc/yellowdog-release

Sun JDS:

cat /etc/sun-release

Solaris/Sparc:

cat /etc/release

Gentoo:

cat  /etc/gentoo-release

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值