Linux查看系统配置信息

Posted 永远相信美好的事情即将发生

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux查看系统配置信息相关的知识,希望对你有一定的参考价值。

一:查看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] /]# 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














































































以上是关于Linux查看系统配置信息的主要内容,如果未能解决你的问题,请参考以下文章

Linux里的lsb_release命令用来查看当前系统的发行版信 息

linux初学者-用户管理篇

Jenkins安装

Android -- 数据存储使用 SharedPreferences 存储数据

怎么在flutter中实现点击按钮发送高德地图上自己实时位置的短信?怎么让位置信息成为短信的内容呢

GEM5中利用Pydot输出系统配置图