linux查看系统版本和系统位数 (转)

简介: 1. uname -ayou will view kernel name、network node hostname、kernel release、kernel version、machine hardware name、processor type 、hardware platform、operating system 2.

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

http://blog.sina.com.cn/s/blog_4fd984420100p4qo.html

相关文章
|
4天前
|
Ubuntu 安全 Linux
《Linux 简易速速上手小册》第1章: Linux 系统基础(2024 最新版)
《Linux 简易速速上手小册》第1章: Linux 系统基础(2024 最新版)
36 1
|
11天前
|
资源调度 JavaScript 搜索推荐
Linux系统之部署envlinks极简个人导航页
【4月更文挑战第11天】Linux系统之部署envlinks极简个人导航页
52 2
|
14天前
|
缓存 Linux 测试技术
安装【银河麒麟V10】linux系统--并挂载镜像
安装【银河麒麟V10】linux系统--并挂载镜像
71 0
|
12天前
|
存储 算法 Linux
【实战项目】网络编程:在Linux环境下基于opencv和socket的人脸识别系统--C++实现
【实战项目】网络编程:在Linux环境下基于opencv和socket的人脸识别系统--C++实现
32 6
|
1天前
|
资源调度 JavaScript Ubuntu
Linux系统之部署briefing视频聊天系统
【4月更文挑战第21天】Linux系统之部署briefing视频聊天系统
9 1
|
2天前
|
Linux Perl
Linux系统替换字符串常用命令
请注意,`sed`命令可以非常强大,可以根据不同的需求使用不同的选项和正则表达式来进行更复杂的字符串替换操作。
16 0
|
7天前
|
运维 网络协议 Unix
18.系统知识-Linux常用命令
18.系统知识-Linux常用命令
|
14天前
|
Web App开发 Linux 网络安全
工作中常用到的Linux命令
工作中常用到的Linux命令
|
15天前
|
Web App开发 Java Linux
Linux之Shell基本命令篇
Linux之Shell基本命令篇
Linux之Shell基本命令篇
|
12天前
|
NoSQL Linux Shell
常用的 Linux 命令
常用的 Linux 命令
34 9