一:cpuhtml
[root@srv /]# more /proc/cpuinfo | grep "model name"linux
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.40GHzui
model name : Intel(R) Xeon(R) CPU X3220 @ 2.40GHzserver
[root@srv /]# grep "model name" /proc/cpuinfohtm
model name : Intel(R) Xeon(R) CPU X3220 @ 2.40GHzblog
model name : Intel(R) Xeon(R) CPU X3220 @ 2.40GHzdns
model name : Intel(R) Xeon(R) CPU X3220 @ 2.40GHz內存
model name : Intel(R) Xeon(R) CPU X3220 @ 2.40GHz
[root@srv /]# 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
二:內存
[root@srv /]# grep MemTotal /proc/meminfo
MemTotal: 614400 kB
[root@srv /]# free -m
total used free shared buffers cached
Mem: 600 23 576 0 0 0
-/+ buffers/cache: 23 576
Swap: 0 0 0
[root@srv /]# free -m |grep "Mem" | awk '{print $2}'
600
三:查看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 /]# more /proc/version
Linux version 2.6.18-92.1.18.el5.028stab060.2PAE ([email=root@rhel5-32-build-xemul]root@rhel5-32-build-xemul[/email]) (gc
c version 4.1.2 20071124 (Red Hat 4.1.2-42)) #1 SMP Tue Jan 13 12:31:30 MSK 2009
五:查看內核版本
[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
www.ifuoo.com
修改主機名
[root@srv /]# cat /etc/sysconfig/network
八:查看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
修改Host文件
[root@srv /]# cat /etc/hosts
十:已經安裝的軟件包
[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
九:查看鍵盤佈局
cat /etc/sysconfig/keyboard
cat /etc/sysconfig/keyboard | grep KEYTABLE | cut -f2 -d=
十二:查看默認語言
echo $LANG $LANGUAGE
cat /etc/sysconfig/i18n
文章來源: http://www.cnblogs.com/lhj588/archive/2012/05/15/2501007.html