1、# uname -a (Linux查看版本当前操作系统内核信息)
Linux localhost.localdomain 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 athlon i386 GNU/Linux
2、# cat /proc/version (Linux查看当前操作系统版本信息)
Linux version 2.4.20-8 (bhcompile@porky.devel.redhat.com)
(gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)) #1 Thu Mar 13 17:54:28 EST 2003
3、# cat /etc/issue 或cat /etc/redhat-release(Linux查看版本当前操作系统发行版信息)
Red Hat Linux release 9 (Shrike)
linux下看配置,可没有windows那么直观。你只能一个一个查看。
一:cpu
[root@srv /]# more /proc/cpuinfo | grep "model
name"
[root@srv /]# grep "model name"
/proc/cpuinfo
二:内存
[root@srv /]# grep MemTotal /proc/meminfo
三:查看CPU位数(32 or 64)
[root@srv /]# getconf LONG_BIT
32
四:查看linux版本
[root@srv /]# more /etc/redhat-release
CentOS
release 5 (Final)
[root@srv /]# more /etc/issue
CentOS release 5 (Final)
Kernel \r on an \m
五:查看内核版本
[root@srv /]# uname
-r
2.6.18-92.1.18.el5.028stab060.2PAE
[root@srv /]# uname -a
Linux srv.eddiechen.cn
2.6.18-92.1.18.el5.028stab060.2PAE #1 SMP Tue Jan 13 12:31:30 MSK
2009 i686 i686 i386 GNU/Linux
六:查看时区
[root@srv /]# date -R
Wed, 25 Feb 2009
02:20:50 +0000
[root@srv /]# mv /etc/localtime
/etc/localtime.save
[root@srv /]# cp /usr/share/zoneinfo/Asia/Shanghai
/etc/localtime
[root@srv /]# date -R
Wed, 25 Feb 2009
10:24:26 +0800
七:主机名
[root@srv /]# hostname
srv.eddiechen.cn
八:查看selinux情况
[root@srv /]# sestatus
SELinux
status:
disabled
九:网络
IP
[root@srv /]# ifconfig
| grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{
print $1}'
207.154.202.216
网关
[root@srv /]# cat /etc/sysconfig/network
NETWORKING="yes"
GATEWAY="192.0.2.1"
HOSTNAME="srv.eddiechen.cn"
dns
[root@srv /]# cat /etc/resolv.conf
nameserver
208.74.168.131
nameserver 208.74.168.132
nameserver 4.2.2.1
十:已经安装的软件包
[root@srv /]# rpm -qa | wc -l
197
[root@srv /]# yum list installed | wc
-l
198
十一:磁盘和分区
[root@srv /]# df
-h
Filesystem
Size
Used
Avail
Use
%
Mounted
on
/dev/simfs
10G
353M
9.7G
4%
/
[root@srv /]# du -sh
353M
[root@srv /]# du /etc
-sh
4.6M
/etc
如何查看已安装的CentOS版本信息:1)[root@localhost ~]# cat /proc/version
Linux version 2.6.18-194.el5 (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Fri Apr 2 14:58:14 EDT 2010
2)
[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:14 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
3)
[root@localhost ~]# uname -r
2.6.18-194.el5
2. 查看linux版本:
1) 列出所有版本信息,
[root@localhost ~]# lsb_release -a
LSB Version::core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: CentOS
Description:CentOS release 5.5 (Final)
Release:5.5
Codename: Final
注:这个命令适用于所有的linux,包括RedHat、SUSE、Debian等发行版。
2) 执行cat /etc/issue,例如如下:
[root@localhost ~]# cat /etc/issue
CentOS release 5.5 (Final)
Kernel r on an m
3) 执行cat /etc/redhat-release ,例如如下:
[root@localhost ~]# cat /etc/redhat-release
CentOS release 5.5 (Final)
查看系统是64位还是32位:
1、getconf LONG_BIT or getconf WORD_BIT
[root@localhost ~]# getconf LONG_BIT
64
2、file /bin/ls
[root@localhost ~]# file /bin/ls
/bin/ls: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped
3、lsb_release -a
[root@localhost ~]# lsb_release -a
LSB Version::core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: CentOS
Description:CentOS release 5.5 (Final)
Release:5.5
Codename: Final
4、或者是使用查看文件的方法。
vim /ect/issue
欢迎分享,转载请注明来源:夏雨云
评论列表(0条)