1.uname -a
you will view kernel name、network node hostname、kernel release、kernel version、machine hardware name、processor type 、hardware platform、operating system
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 ([email protected]) (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: [email protected]
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
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:
不同的 UNIX-like 操作系统根据他们的发行版本不同而存储信息不同
bash-3.1$ cat /etc/redhat-releaseRed Hat Enterprise Linux Client release 5 (Tikanga)
bash-3.1$ cat /etc/issueUbuntu 6.10 n l
~> cat /etc/SuSE-releaseSUSE Linux Enterprise Desktop 10 (x86_64)VERSION = 10~ # getconf LONG_BIT
32
getconf命令还可以获取系统的基本配置信息,比如操作系统位数,内存大小,磁盘大小等
bash-2.03$ cat /etc/releaseSolaris 8 2/04 s28s_hw4wos_05a SPARCCopyright 2004 Sun Microsystems, Inc. All Rights Reserved.Assembled 08 January 2004