常常有客戶諮詢雲志互聯查看服務器一些硬件配置的方法,下面將以Centos爲例,將各類信息的查看方法與用戶分享。本教程使用於Centos,Debian等各Linux發行版linux
目錄[隱藏] |
grep "model name" /proc/cpuinfo | cut -f2 -d:服務器
grep MemTotal /proc/meminfo佈局
grep MemTotal /proc/meminfo | cut -f2 -d:ui
free -m |grep "Mem" | awk '{print $2}'spa
getconf LONG_BITorm
more /etc/redhat-release cat /etc/redhat-release教程
uname -rvps
uname -aip
date內存
df -h
fdisk -l
du /etc -sh
cat -n /root/install.log
more /root/install.log | wc -l
rpm -qa
rpm -qa | wc -l
yum list installed | wc -l
cat /etc/sysconfig/keyboard
cat /etc/sysconfig/keyboard | grep KEYTABLE | cut -f2 -d=
查看Selinux狀態
sestatus
sestatus | cut -f2 -d:
cat /etc/sysconfig/selinux
在ifcfg-eth0 文件裏你能夠看到mac,網關等信息。
ifconfig
cat /etc/sysconfig/network-scripts/ifcfg-eth0 | grep IPADDR
cat /etc/sysconfig/network-scripts/ifcfg-eth0 | grep IPADDR | cut -f2 -d=
ifconfig eth0 |grep "inet addr:" |awk '{print $2}'|cut -c 6-
ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'
cat /etc/sysconfig/network
cat /etc/resolv.conf
echo $LANG $LANGUAGE
cat /etc/sysconfig/i18n
cat /etc/sysconfig/clock
hostname
cat /etc/sysconfig/network