CentOS檢視系統資訊-CentOS檢視命令
阿新 • • 發佈:2018-12-27
一:檢視cpu
- more /proc/cpuinfo | grep "model name"
- grep "model name" /proc/cpuinfo
如果覺得需要看的更加舒服
- grep "model name" /proc/cpuinfo | cut -f2 -d:
怎麼樣,linux的命令就要這樣熟悉。
二:檢視內
- [[email protected] ~]# grep MemTotal /proc/meminfo
- [[email protected] ~]# grep MemTotal /proc/meminfo | cut -f2 -d:
- [[email protected]
- [[email protected] ~]# free -m
三:檢視cpu是32位還是64位
檢視CPU位數(32 or 64)
- [[email protected] ~]# getconf LONG_BIT
- [[email protected] ~]# echo $HOSTTYPE
- [[email protected] ~]# uname -a
四:檢視當前linux的版本
- [[email protected] ~]# more /etc/redhat-release
- [[email protected] ~]# cat /etc/redhat-release
五:檢視核心版本
- [[email protected] ~]# uname -r
- [[email protected] ~]# uname -a
六:檢視當前時間
- [[email protected] ~]# date
七:檢視硬碟和分割槽
- [[email protected] ~]# df -h
- [[email protected] ~]# fdisk -l
也可以檢視分割槽
- [[email protected] home]# du -sh
可以看到全部佔用的空間
- [[email protected] home]# du /var/www -sh
可以看到這個目錄的大小
八:檢視安裝的軟體包
檢視系統安裝的時候裝的軟體包
- cat -n /root/install.log
- more /root/install.log | wc -l
檢視現在已經安裝了那些軟體包
- [[email protected] home]# rpm -qa
- .......................
- .......................
- .......................
- .......................
- .......................
- [[email protected] home]# rpm -qa | wc -l
- [[email protected] home]# yum list installed | wc -l
不過很奇怪,我通過rpm,和yum這兩種方式查詢的安裝軟體包,數量並不一樣。沒有找到原因。
九:檢視鍵盤佈局
- [[email protected] home]# cat /etc/sysconfig/keyboard
- [[email protected] home]# cat /etc/sysconfig/keyboard | grep KEYTABLE | cut -f2 -d=
十:檢視selinux情況
- [[email protected] home]# sestatus
- [[email protected] home]# sestatus | cut -f2 -d:
- [[email protected] home]# cat /etc/sysconfig/selinux
十一:檢視ip,mac地址
在ifcfg-eth0 檔案裡你可以看到mac,閘道器等資訊。
- [[email protected] home]# ifconfig
- [[email protected] home]# cat /etc/sysconfig/network-scripts/ifcfg-Auto_eth0
- [[email protected] home]# cat /etc/sysconfig/network-scripts/ifcfg-Auto_eth0 | grep IPADDR | cut -f2 -d=
- [[email protected] home]# ifconfig eth0 |grep "inet addr:" |awk '{print $2}'|cut -c 6-
- [[email protected] home]# ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'
檢視閘道器
- [[email protected] home]# cat /etc/sysconfig/network
檢視dns
- [[email protected] home]# cat /etc/resolv.conf
十二:檢視預設語言
- [[email protected] home]# echo $LANG $LANGUAGE
- [[email protected] home]# cat /etc/sysconfig/i18n
十三:檢視所屬時區和是否使用UTC時間
- [[email protected] /]# cat /etc/sysconfig/clock
十四:檢視主機名
- [[email protected] /]# hostname
- [[email protected] /]# cat /etc/sysconfig/network