Windows XP Windows 7 Windows 2003 Windows Vista Windows教程綜合 Linux 系統教程
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟件教程
 Windows教程網 >> Linux系統教程 >> Linux系統常見問題解答 >> Linux硬件信息查詢命令

Linux硬件信息查詢命令

日期:2017/1/20 17:40:59      編輯:Linux系統常見問題解答

系統

uname -a # 查看內核/操作系統/CPU信息
Linux hostname 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
head -n 1 /etc/issue # 查看操作系統版本
Red Hat Enterprise Linux Server release 5.3 (Tikanga)
cat /proc/cpuinfo # 查看CPU信息
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 44
model name      : Intel(R) Xeon(R) CPU           X5670  @ 2.93GHz
stepping        : 2
cpu MHz         : 2933.582
cache size      : 12288 KB
physical id     : 1
siblings        : 12
core id         : 0
cpu cores       : 6
apicid          : 32
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx pdpe1gb rdtscp lm constant_tsc ida pni monitor ds_cpl vmx smx est tm2 cx16 xtpr popcnt lahf_lm
bogomips        : 5871.13
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:
hostname # 查看計算機主機名  
hostname.com.cn
lspci -tv # 列出所有PCI設備
-[0000:00]-+-00.0  Intel Corporation 5500 I/O Hub to ESI Port
           +-01.0-[02]--+-00.0  Broadcom Corporation NetXtreme II BCM57711E 10-G                       igabit PCIe
           |            \-00.1  Broadcom Corporation NetXtreme II BCM57711E 10-G                       igabit PCIe
           +-02.0-[0d]--
           +-03.0-[03-05]--
           +-07.0-[06-08]--
           +-08.0-[11]--
           +-09.0-[09-0b]--+-00.0  QLogic Corp. ISP2432-based 4Gb Fibre Channel  
lsusb -tv # 列出所有USB設備
Bus#  6
`-Dev#   1 Vendor 0x0000 Product 0x0000
`-Dev#   2 Vendor 0x03f0 Product 0x1027
Bus#  5
`-Dev#   1 Vendor 0x0000 Product 0x0000
Bus#  4
`-Dev#   1 Vendor 0x0000 Product 0x0000
Bus#  3
`-Dev#   1 Vendor 0x0000 Product 0x0000
Bus#  2
`-Dev#   1 Vendor 0x0000 Product 0x0000
Bus#  1
`-Dev#   1 Vendor 0x0000 Product 0x0000
lsmod # 列出加載的內核模塊 env # 查看環境變量資源
_=/bin/env
CVS_RSH=ssh
G_BROKEN_FILENAMES=1
HISTSIZE=1000
HOME=/root
INPUTRC=/etc/inputrc
KDEDIR=/usr
KDE_IS_PRELINKED=1
KDE_NO_IPV6=1
LANG=en_US.UTF-8
LESSOPEN=|/usr/bin/lesspipe.sh %s
LOGNAME=root
MAIL=/var/spool/mail/root
PATH=/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
free -m # 查看內存使用量和交換區使用量
             total       used       free     shared    buffers     cached
Mem:         48295       9647      38648       0       1165        4067
-/+ buffers/cache:       4413      43881
Swap:         3999          0       3999 
df -h # 查看各分區使用情況

 

Filesystem            Size  Used   Avail   Use%      Mounted on
/dev/mapper/rootVG-root
                       83G  7.4G   72G     10%      /
/dev/mapper/rootVG-tmp
                      3.9G  137M  3.6G     4%       /tmp
/dev/mapper/rootVG-var
                       31G  5.1G   24G     18%      /var
du -sh <目錄名> # 查看指定目錄的大小

 

# du -sh /tmp
84K     /tmp
grep MemTotal /proc/meminfo # 查看內存總量

 

<pre name="code" class="plain"># <span style="font-family: Arial, Helvetica, sans-serif;">grep MemTotal /proc/meminfo</span>
MemTotal: 16432172 kB 

grep MemFree /proc/meminfo # 查看空閒內存量

# grep MemFree /proc/meminfo
MemFree:      12647164 kB
uptime # 查看系統運行時間、用戶數、負載
14:15:28 up 4 days,  2:56,  1 user,  load average: 1.17, 1.15, 1.10
cat /proc/loadavg # 查看系統負載
# cat /proc/loadavg
1.11 1.14 1.09 1/546 5175

磁盤和分區

mount | column -t # 查看掛接的分區狀態
/dev/mapper/rootVG-root     on  /         type  ext3    (rw)
proc                        on  /proc     type  proc    (rw)
sysfs                       on  /sys      type  sysfs   (rw)
devpts                      on  /dev/pts  type  devpts  (rw,gid=5,mode=620)
/dev/mapper/rootVG-tmp      on  /tmp      type  ext3    (rw)
fdisk -l # 查看所有分區
Disk /dev/cciss/c0d0: 146.7 GB, 146778685440 bytes
255 heads, 63 sectors/track, 17844 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
           Device Boot      Start         End      Blocks   Id  System
/dev/cciss/c0d0p1   *           1          19      152586   83  Linux
/dev/cciss/c0d0p2              20       17844   143179312+  8e  Linux LVM
Disk /dev/sdc: 384.3 GB, 384399572992 bytes
255 heads, 63 sectors/track, 46733 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdc doesn't contain a valid partition table
Disk /dev/sde: 225.4 GB, 225485783040 bytes
255 heads, 63 sectors/track, 27413 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
swapon -s # 查看所有交換分區
Filename                                Type            Size    Used    Priority
/dev/mapper/rootVG-swap                 partition       16777208        0       -1
hdparm -i /dev/hda # 查看磁盤參數(僅適用於IDE設備)dmesg | grep IDE # 查看啟動時IDE設備檢測狀況
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
Probing IDE interface ide0...
Probing IDE interface ide1... 

網絡

ifconfig # 查看所有網絡接口的屬性
bond0     Link encap:Ethernet  HWaddr F4:CE:46:7E:D7:68
          inet addr:10.56.236.101  Bcast:10.56.236.127  Mask:255.255.255.128
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:196625663 errors:0 dropped:0 overruns:0 frame:0
          TX packets:166879878 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:30475502617 (28.3 GiB)  TX bytes:34248137790 (31.8 GiB)
eth0      Link encap:Ethernet  HWaddr F4:CE:46:7E:D7:68
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:196625663 errors:0 dropped:0 overruns:0 frame:0
          TX packets:166879878 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:30475502617 (28.3 GiB)  TX bytes:34248137790 (31.8 GiB)
          Interrupt:130 Memory:fb000000-fb7fffff
					
                
              
            
        

						
Copyright © Windows教程網 All Rights Reserved