LINUX查看系统配置

拿到一个系统,肯定要看看系统配置,linux下看配置,可没有windows那么直观。你只能一个一个查看。
一:cpu
# 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
# 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
# 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
二:内存
# grep MemTotal /proc/meminfo
MemTotal: 614400 kB
# free -m
total used free shared buffers cached
Mem: 600 23 576 0 0 0
-/+ buffers/cache: 23 576
Swap: 0 0 0
# free -m |grep "Mem" | awk '{print $2}'
600
三:查看CPU位数(32 or 64)
# getconf LONG_BIT
32
四:查看linux版本
# more /etc/redhat-release
CentOS release 5 (Final)
# more /etc/issue
CentOS release 5 (Final)
Kernel \r on an \m

# 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
五:查看内核版本
# uname -r
2.6.18-92.1.18.el5.028stab060.2PAE
# 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
六:查看时区
# date -R
Wed, 25 Feb 2009 02:20:50 +0000
# mv /etc/localtime /etc/localtime.save
# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# date -R
Wed, 25 Feb 2009 10:24:26 +0800
七:主机名
# hostname
srv.eddiechen.cn
八:查看selinux情况
# sestatus
SELinux status: disabled
九:网络
IP
# ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'
207.154.202.216
网关
# cat /etc/sysconfig/network
NETWORKING="yes"
GATEWAY="192.0.2.1"
HOSTNAME="srv.eddiechen.cn"
dns
# cat /etc/resolv.conf
nameserver 208.74.168.131
nameserver 208.74.168.132
nameserver 4.2.2.1
十:已经安装的软件包
# rpm -qa | wc -l
197
# yum list installed | wc -l
198
十一:磁盘和分区
# df -h
Filesystem Size Used Avail Use % Mounted on
/dev/simfs 10G 353M 9.7G 4% /
# du -sh
353M
# du /etc -sh
4.6M /etc

你可能感兴趣的:(LINUX查看系统信息)