Linux系统查看CPU、机器型号、内存等信息

ç³»ç»ç»´æ¤æ¶éæ¶å¯è½æéè¦æ¥ç CPU 使ç¨çï¼å¹¶æ ¹æ®ç¸åºä¿¡æ¯åæç³»ç»ç¶åµçéè¦ãå¨ linux 中ï¼å¯ä»¥éè¿ top å½ä»¤æ¥æ¥ç CPU 使ç¨ç¶åµãå³äº top å½ä»¤ç详ç»è¯´æ请åç 使ç¨topå½ä»¤åælinuxç³»ç»æ§è½ç详解 è¿ç¯æç« ã

topå½ä»¤æ¯Linuxä¸å¸¸ç¨çæ§è½åæå·¥å·ï¼è½å¤å®æ¶æ¾ç¤ºç³»ç»ä¸­å个è¿ç¨çèµæºå ç¨ç¶åµï¼ç±»ä¼¼äºWindowsçä»»å¡ç®¡çå¨ï¼ä¸è¿è¿éæ们主è¦æ¯ä»ç»ä¸ä¸ linux ç³»ç»å¦ä½æ¥çCPUä¿¡æ¯ãæºå¨åå·ãåå­ä¿¡æ¯ç­ã

ç³»ç»

# uname -a        # æ¥çåæ ¸/æä½ç³»ç»/CPUä¿¡æ¯
# head -n 1 /etc/issue  # æ¥çæä½ç³»ç»çæ¬
# cat /proc/cpuinfo   # æ¥çCPUä¿¡æ¯
# hostname        # æ¥ç计ç®æºå
# lspci -tv       # ååºææPCI设å¤
# lsusb -tv       # ååºææUSB设å¤
# lsmod         # ååºå è½½çå核模å
# env          # æ¥çç¯å¢åé

èµæº

# free -m        # æ¥çåå­ä½¿ç¨éå交æ¢åºä½¿ç¨é
# df -h         # æ¥çåååºä½¿ç¨æåµ
# du -sh <ç®å½å>    # æ¥çæå®ç®å½ç大å°
# grep MemTotal /proc/meminfo  # æ¥çåå­æ»é
# grep MemFree /proc/meminfo  # æ¥ç空é²åå­é
# uptime         # æ¥çç³»ç»è¿è¡æ¶é´ãç¨æ·æ°ãè´è½½
# cat /proc/loadavg   # æ¥çç³»ç»è´è½½

ç£çåååº

# mount | column -t   # æ¥çææ¥çååºç¶æ
# fdisk -l        # æ¥çææååº
# swapon -s       # æ¥çææ交æ¢ååº
# hdparm -i /dev/hda   # æ¥çç£çåæ°(ä»éç¨äºIDE设å¤)
# dmesg | grep IDE    # æ¥çå¯å¨æ¶IDE设å¤æ£æµç¶åµ

ç½ç»

# ifconfig        # æ¥çææç½ç»æ¥å£çå±æ§
# iptables -L      # æ¥çé²ç«å¢è®¾ç½®
# route -n        # æ¥çè·¯ç±è¡¨
# netstat -lntp     # æ¥çææçå¬ç«¯å£
# netstat -antp     # æ¥çææå·²ç»å»ºç«çè¿æ¥
# netstat -s       # æ¥çç½ç»ç»è®¡ä¿¡æ¯

è¿ç¨

# ps -ef         # æ¥çææè¿ç¨
# top          # å®æ¶æ¾ç¤ºè¿ç¨ç¶æ

ç¨æ·

# w           # æ¥çæ´»å¨ç¨æ·
# id <ç¨æ·å>      # æ¥çæå®ç¨æ·ä¿¡æ¯
# last          # æ¥çç¨æ·ç»å½æ¥å¿
# cut -d: -f1 /etc/passwd  # æ¥çç³»ç»ææç¨æ·
# cut -d: -f1 /etc/group  # æ¥çç³»ç»ææç»
# crontab -l       # æ¥çå½åç¨æ·ç计åä»»å¡

æå¡

# chkconfig --list    # ååºææç³»ç»æå¡
# chkconfig --list | grep on  # ååºææå¯å¨çç³»ç»æå¡

ç¨åº

# rpm -qa        # æ¥çææå®è£ç软件å

æ¥çCPUä¿¡æ¯ï¼åå·ï¼

# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c 
   8 Intel(R) Xeon(R) CPU      E5410  @ 2.33GHz 
(çå°æ8个é»è¾CPU, ä¹ç¥éäºCPUåå·) 

# cat /proc/cpuinfo | grep physical | uniq -c 
   4 physical id   : 0 
   4 physical id   : 1 
(说æå®éä¸æ¯ä¸¤é¢4æ ¸çCPU) 

# getconf LONG_BIT 
  32 
(说æå½åCPUè¿è¡å¨32bit模å¼ä¸, ä½ä¸ä»£è¡¨CPUä¸æ¯æ64bit) 

# cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l 
  8 
(ç»æ大äº0, 说ææ¯æ64bit计ç®. lmælong mode, æ¯ælmåæ¯64bit)

åå®æ´çcpu详ç»ä¿¡æ¯, ä¸è¿å¤§é¨åæ们é½ä¸å³å¿èå·².

# dmidecode | grep 'Processor Information'

æ¥çåå­ä¿¡æ¯

# cat /proc/meminfo 

# uname -a 
Linux euis1 2.6.9-55.ELsmp #1 SMP Fri Apr 20 17:03:35 EDT 2007 i686 i686 i386 GNU/Linux 
(æ¥çå½åæä½ç³»ç»å核信æ¯) 

# cat /etc/issue | grep Linux 
Red Hat Enterprise Linux AS release 4 (Nahant Update 5) 
(æ¥çå½åæä½ç³»ç»åè¡çä¿¡æ¯)

æ¥çæºå¨åå·

# dmidecode | grep "Product Name"

æ¥çç½å¡ä¿¡æ¯

# dmesg | grep -i eth

æ»ç»

以ä¸å°±æ¯è¿ç¯æç« çå¨é¨å容äºï¼å¸ææ¬æçå容对大家ç学习æèå·¥ä½å·æä¸å®çåè学习价å¼ï¼è°¢è°¢å¤§å®¶å¯¹èæ¬ä¹å®¶çæ¯æãå¦æä½ æ³äºè§£æ´å¤ç¸å³å容请æ¥çä¸é¢ç¸å³é¾æ¥

相关推荐