一:查看cpu
[[email protected] /]# more /proc/cpuinfo | grep "model name"
model name : Intel(R) Xeon(R) CPU X3220 @ 2.40GHz
model name : Intel(R) Xeon(R) CPU X3220 @ 2.40GHz
model name : Intel(R) Xeon(R) CPU X3220 @ 2.40GHz
model name : Intel(R) Xeon(R) CPU X3220 @ 2.40GHz
[[email protected] /]# grep "model name" /proc/cpuinfo
model name : Intel(R) Xeon(R) CPU X3220 @ 2.40GHz
model name : Intel(R) Xeon(R) CPU X3220 @ 2.40GHz
model name : Intel(R) Xeon(R) CPU X3220 @ 2.40GHz
model name : Intel(R) Xeon(R) CPU X3220 @ 2.40GHz
[[email protected] /]# grep "model name" /proc/cpuinfo | cut -f2 -d:
Intel(R) Xeon(R) CPU X3220 @ 2.40GHz
Intel(R) Xeon(R) CPU X3220 @ 2.40GHz
Intel(R) Xeon(R) CPU X3220 @ 2.40GHz
Intel(R) Xeon(R) CPU X3220 @ 2.40GHz
二:查看内存
[[email protected] /]# grep MemTotal /proc/meminfo
MemTotal: 614400 kB
[[email protected] /]# free -g
[[email protected] /]# free -m
total used free shared buffers cached
Mem: 600 23 576 0 0 0
-/+ buffers/cache: 23 576
Swap: 0 0 0
[[email protected] /]# free -m |grep "Mem" | awk ‘{print $2}‘
600[[email protected] /]#grep MemTotal /proc/meminfo | cut -f2 -d:
kB
(k|K|m|M) 以k|kB|m|MB为单位显示,对应转换(1000|1024|1000000|1048576)
三:查看CPU位数(32 or 64)
[[email protected] /]# getconf LONG_BIT
四:查看linux版本
[[email protected] /]# more /etc/redhat-release
CentOS release 5 (Final)
[[email protected] /]# more /etc/issue
CentOS release 5 (Final)
Kernel \r on an \m
[[email protected] /]# more /proc/version
Linux version 2.6.18-92.1.18.el5.028stab060.2PAE ([[email protected]][email protected][/email]) (gc
c version 4.1.2 20071124 (Red Hat 4.1.2-42)) #1 SMP Tue Jan 13 12:31:30 MSK 2009
五:查看内核版本
[[email protected] /]# uname -r
2.6.18-92.1.18.el5.028stab060.2PAE
[[email protected] /]# 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
六:查看时区
[[email protected]v /]# date -R
Wed, 25 Feb 2009 02:20:50 +0000
[[email protected] /]# mv /etc/localtime /etc/localtime.save
[[email protected] /]# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
[[email protected] /]# date -R
Wed, 25 Feb 2009 10:24:26 +0800
七:主机名
[[email protected] /]# hostname
srv.eddiechen.cn
八:查看selinux情况
[[email protected] /]# sestatus
SELinux status: disabled
九:网络
IP
[[email protected] /]# ifconfig | grep ‘inet addr:‘| grep -v ‘127.0.0.1‘ | cut -d: -f2 | awk ‘{ print $1}‘
207.154.202.216
网关
[[email protected] /]# cat /etc/sysconfig/network
NETWORKING="yes"
GATEWAY="192.0.2.1"
HOSTNAME="srv.eddiechen.cn"
dns
[[email protected] /]# cat /etc/resolv.conf
nameserver 208.74.168.131
nameserver 208.74.168.132
nameserver 4.2.2.1
十:已经安装的软件包
[[email protected] /]# rpm -qa | wc -l
[[email protected] /]# yum list installed | wc -l
十一:磁盘和分区
[[email protected] /]# df -h
Filesystem Size Used Avail Use % Mounted on
/dev/simfs 10G 353M 9.7G 4% /
[[email protected] /]# du -sh
353M
[[email protected] /]# du /etc -sh
4.6M /etc