linux查看系統版本和系統位數


1. uname -a

you will view  kernel name、network node hostname、kernel release、kernel version、machine hardware name、processor type 、hardware platform、operating system

2. cat /proc/version

his file will not show you the name of the actual OS release, but will instead give you specifics about the version of Linux kernel used in your distribution, and confirm the version of a GCC compiler used to build it.

If you cat the /proc/version file, this is what you're going to see (I'm using a CentOS 5.4 system for this):

cat /proc/version

Linux version 2.6.18-164.11.1.el5 (mockbuild@builder16.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)) #1 SMP Wed Jan 20 07:39:04 EST 2010

In this output, you get to see the following information:

Exact version of the Linux kernel used in your OS: Linux version 2.6.18-164.11.1.el5

Name of the user who compiled your kernel, and also a host name where it happened: mockbuild@builder16.centos.org

Version of the GCC compiler used for building the kernel: gcc version 4.1.2 20080704

Type of the kernel – SMP here means Symmetric MultiProcessing kernel, the one that supports systems with multiple CPUs or multiple cpu cores

Date and time when the kernel was built: Wed Jan 20 07:39:04 EST 2010

3. cat /etc/issue

Catting /proc/version or uname will only show you information that has been set for compile into the kernel. Only the major distributions will put some special marks for identification, in the form such as custom kernel version tag or gcc version string. But this is not necessarily true especially if the kernel is a self compiled kernel.

For example, here is the /proc/version from my Slackware server:

4. lsb_release -a

這個命令適用於所有的linux,包括Redhat、SuSE、Debian等發行版,但不能查看系統位數。

5.如果你知道你的操作系統是什么,但不確定具體版本,下面有幾種方法你可以使用

不同的 UNIX-like 操作系統根據他們的發行版本不同而存儲信息不同

RedHat Linux

bash-3.1$ cat /etc/redhat-release
Red Hat Enterprise Linux Client release 5 (Tikanga)

Ubuntu Linux

bash-3.1$ cat /etc/issue
Ubuntu 6.10 n l

SUSE Linux

~> cat /etc/SuSE-release
SUSE Linux Enterprise Desktop 10 (x86_64)
VERSION = 10

Sun Solaris

bash-2.03$ cat /etc/release
Solaris 8 2/04 s28s_hw4wos_05a SPARC
Copyright 2004 Sun Microsystems, Inc.  All Rights Reserved.
Assembled 08 January 2004


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM