Linux View hardware information commands

Source: Internet
Author: User
Tags dmesg

Cpu

The LSCPU command, which looks at the CPU statistics.

[Email protected]:~$ lscpu

architecture:i686 #cpu架构

CPU Op-mode (s): 32-bit, 64-bit

Byte Order:little Endian #小尾序

CPU (s): 4 #总共有4核

On-line CPU (s) list:0-3thread (s) per Core:1 #每个cpu核, only one thread is supported, that is, hyper-threading is not supported

Core (s) per Socket:4 #每个cpu with 4 cores

Socket (s): 1 #总共有1一个cpu

Vendor Id:genuineintel #cpu产商 Intel

CPU family:6model:42stepping:7cpu mhz:1600.000bogomips: 5986.12virtualization:vt-x #支持cpu虚拟化技术

L1D cache:32k

L1i cache:32k

L2 cache:256k

L3 cache:6144k


View/proc/cpuinfo, you can know each CPU information, such as the model of each CPU, the frequency and so on.

#cat/proc/cpuinfo

Processor:0vendor_id:genuineintel

CPU Family:6model:42model Name:intel (R) Core (TM) i5-2320 CPU @ 3.00GHz

.....

The above output is the first CPU part of the information, there are 3 of CPU information omitted.



Memory

Overview of Memory

#free-M

Total used free shared buffers Cached

mem:3926 3651 274 0 404-/+ buffers/cache:3235 691Swap: 9536 31 9505

The unit here is MB, and the total memory is 3926MB.


View Memory Detail Usage

# Cat/proc/meminfo

memtotal:4020868 KB

memfree:230884 KB

buffers:7600 KB

cached:454772 KB

swapcached:836 KB

.....


View Memory Hardware Information

#dmidecode-T memory

# Dmidecode 2.11SMBIOS 2.7 present.


Handle 0x0008, DMI type, bytes

Physical Memory Array

Location:system Board Or Motherboard

....

Maximum capacity:32 GB

....


Handle 0x000A, DMI type, bytes

....

Memory Device

Array handle:0x0008

Error Information Handle:not provided

Total width:64 Bits

Data width:64 Bits

size:4096 MB

.....

My motherboard has 4 slots, with only one slot, with a 4096MB of memory plugged in.



Disk

View hard disk and partition distribution

# LSBLK

NAME maj:min RM SIZE RO TYPE mountpoint

SDA 8:0 0 465.8G 0 disk

├─SDA1 8:1 0 1G 0 part/boot

├─sda2 8:2 0 9.3G 0 part [SWAP]

├─sda3 8:3 0 74.5G 0 part/├─sda4 8:4 0 1K 0 part

├─sda5 8:5 0 111.8G 0 part/home

└─sda6 8:6 0 269.2G 0 part

Display is intuitive



If you want to see hard disk and partition details

# fdisk-l

disk/dev/sda:500.1 GB, 500107862016 bytes255 heads, sectors/track, 60801 cylinders, total 976773168 sectors

Units = sectors of 1 * MB = bytes

Sector size (logical/physical): bytes/4096 bytes

I/O size (minimum/optimal): 4096 bytes/4096 bytes

Disk identifier:0x00023728


Device Boot Start End Blocks Id system/dev/sda1 * 2048 2148351 1073152-linux/d Ev/sda2 2148352 21680127 9765888 21680128 Linux swap/solaris/dev/sda3 177930239 7812505 6 linux/dev/sda4 177932286 976771071 399419393 5 extended/dev/sda5 177932288 412305407 11718 6560 Linux/dev/sda6 412307456 976771071 282231808 Linux



Card

Viewing NIC hardware information

# Lspci | Grep-i ' ETH ' 02:00.0 Ethernet Controller:realtek Semiconductor Co., Ltd. rtl8111/8168b PCI Express Gigabit Ethernet contr Oller (Rev 06)


View all network interfaces of the system

# ifconfig-a

eth0 Link ENCAP: Ethernet Hardware Address b8:97:5a:17:b3:8f

.....

Lo Link encap: local loopback

.....

or a

IP link show1:lo: <LOOPBACK> MTU 16436 Qdisc noqueue State down

Link/loopback 00:00:00:00:00:00 BRD 00:00:00:00:00:002:eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> MTU Qdisc Pfifo_fast state up Qlen 1000link/ether b8:97:5a:17:b3:8f BRD ff:ff:ff:ff:ff:ff


If you want to view the details of a network interface, such as detailed parameters and metrics for eth0

# Ethtool Eth0

Settings for eth0:

Supported ports: [TP MII]

Supported Link Modes:10baset/half 10baset/full

100baset/half 100baset/full

1000baset/half 1000baset/full #支持千兆半双工, full duplex mode

Supported Pause Frame Use:no

Supports Auto-negotiation:yes #支持自适应模式, generally support

Advertised Link Modes:10baset/half 10baset/full

100baset/half 100baset/full

1000baset/half 1000baset/full

Advertised Pause frame use:symmetric receive-only

Advertised Auto-negotiation:yes #默认使用自适应模式

Link Partner advertised link modes:10baset/half 10baset/full

100baset/half 100baset/full

.....

SPEED:100MB/S #现在网卡的速度是100Mb, the network adapter uses adaptive mode, so it is assumed that the route is 100Mb, resulting in the network card from supporting the gigabit, to support the hundred trillion

Duplex:full #全双工 .....

Link Detected:yes #表示有网线连接, and routing is pass-through

Other

View PCI information, which is the motherboard's hardware slot information.


lspci00:00.0 Host Bridge:intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev.) #主板芯片00:02.0 VGA Compatible Controller:intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev.) #显卡 00:14.0 USB Controller:intel Corporation Panther Point USB XHCI Host Controller (rev.) #usb控制器00:16.0 communication con Troller:intel Corporation Panther Point MEI Controller #1 (rev.) 00:1a.0 USB Controller:intel Corporation Panther Point USB Enhanced Host Controller #2 (rev.) 00:1b.0 audio Device:intel Corporation Panther Point High Definition Audio contr Oller (rev.) #声卡00:1c.0 PCI bridge:intel Corporation Panther Point PCI Express Root Port 1 (Rev C4) #pci socket 00:1C.2 PCI Bridge:intel Corporation Panther Point PCI Express Root Port 3 (rev C4) 00:1c.3 PCI bridge:intel Corporation Panther poin T PCI Express Root Port 4 (rev. C4) 00:1d.0 usb controller:intel Corporation Panther Point USB enhanced Host Controller #1 (rev.) 00:1f.0 ISA BridGe:intel Corporation Panther Point LPC Controller (rev.) 00:1f.2 IDE Interface:intel Corporation Panther point 4 Port S ATA Controller [IDE mode] (rev.) #硬盘接口00:1f.3 smbus:intel Corporation Panther point SMBus Controller (rev.) 00:1f.5 ID E Interface:intel Corporation Panther point 2 port SATA controller [IDE mode] (rev) #硬盘接口02:00.0 Ethernet Controller: Realtek Semiconductor Co., Ltd. rtl8111/8168b PCI Express Gigabit Ethernet Controller (rev.) #网卡03:00.0 PCI Bridge:inte Grated Technology Express, Inc. Device 8893 (Rev. 41)


If you want more detailed information: Lspci-v or LSPCI-VV


If you want to see the device tree: lscpi-t


View BIOS Information

# DMIDECODE-T BIOS

......

BIOS Information

Vendor:american megatrends Inc.

version:4.6.5

Release date:04/25/2012

.......

BIOS revision:4.6 ...


Dmidecode dumps the DMI (Desktop Management Interface) information of the machine in a readable manner. This information includes both the hardware and the BIOS, as well as the current configuration and the maximum configuration supported by the system, such as the maximum amount of memory supported.


If you want to see all the useful information


Dmidecode-q

It contains a lot of hardware information.


-------------------------------------------

System

# uname-a # View kernel/Os/cpu information

# head-n 1/etc/issue # view OS version

# cat/proc/cpuinfo # View CPU Information

# hostname # View computer name

# LSPCI-TV # list all PCI devices

# LSUSB-TV # list all USB devices

# lsmod # List of loaded kernel modules

# env # View Environment variables



Resources

# free-m # View memory usage and swap area usage

# df-h # View the usage of each partition

# du-sh < directory name > # View the size of the specified directory

# grep Memtotal/proc/meminfo # View Total Memory

# grep Memfree/proc/meminfo # View the amount of free memory

# uptime # View System uptime, number of users, load

# cat/proc/loadavg # View System load



Disks and partitions

# Mount | COLUMN-T # Viewing the status of a mounted partition

# fdisk-l # View all partitions

# swapon-s # View all swap partitions

# hdparm-i/dev/hda # View disk parameters (for IDE devices only)

# DMESG | grep IDE # View IDE device detection status at startup



Internet

# ifconfig # View the properties of all network interfaces

# iptables-l # View firewall settings

# route-n # View the routing table

# netstat-lntp # View all listening ports

# NETSTAT-ANTP # View all established connections

# netstat-s # View Network statistics



Process

# ps-ef # View All Processes

# top # Real-time display of process status



User

# w # View active Users

# ID < user name > # view specified user information

# last # View user log in log

# cut-d:-f1/etc/passwd # View All users of the system

# cut-d:-f1/etc/group # View all system groups

# crontab-l # View Current user's scheduled tasks



Service

# chkconfig--list # list all system services

# chkconfig--list | grep on # Lists all startup system services



Common commands are organized as follows:

View the serial number of the motherboard: Dmidecode | Grep-i ' Serial number '

Detecting new hardware with hardware detection program Kuduz: Service kudzu start (or restart)

View CPU information: Cat/proc/cpuinfo [DMESG | grep-i ' CPU '][DMIDECODE-T processor]

View memory information: Cat/proc/meminfo [Free-m][vmstat]

View card information: CAT/PROC/PCI

View video card/sound card information: Lspci |grep-i ' VGA ' [DMESG | grep-i ' VGA ']

View nic Information: DMESG | Grep-i ' ETH ' [cat/etc/sysconfig/hwconf | grep-i eth][lspci | grep-i ' ETH ']

View PCI information: LSPCI (more intuitive than CAT/PROC/PCI)

View USB devices: Cat/proc/bus/usb/devices

Viewing the keyboard and mouse: Cat/proc/bus/input/devices

View system hard disk information and usage: Fdisk & disk–l & DF

To view interrupt requests (IRQ) for each device: cat/proc/interrupts

View and start the system's 32-bit or 64-bit kernel mode: isalist–v [isainfo–v][isainfo–b]

Dmidecode viewing hardware information, including BIOS, CPU, memory, etc.

Determine the current display refresh rate:/usr/sbin/ffbconfig–rev \?

View System configuration:/usr/platform/sun4u/sbin/prtdiag–v

To view patches already applied in the current system: showrev–p

Displays the current runlevel: WHO–RH

View current BIND version information: Nslookup–class=chaos–q=txt Version.bind



DMESG | More View hardware information

LSPCI display peripheral information, such as USB, network card and other information

Lsnod Viewing loaded drivers

Lshw

PSRINFO-V view current processor type and speed (frequency)

Prtconf-v Print the current OBP version number

Iostat–e viewing hard disk physical information (vendor, RPM, capacity)

Prtvtoc/dev/rdsk/c0t0d0s viewing the geometry and partitioning information for a disk

Df–f Ufs–o I shows the number of i-node that have been used and not used

Isalist–v



For files in "/proc", you can use the File View command to browse its contents, and the file contains system-specific information:

Cpuinfo Host CPU Information

DMA Host DMA Channel information

Filesystems File System Information

Interrupts host interrupt Information

Ioprots host I/O port number information

Meninfo Host Memory Information

Version Linux memory release information

Note: proc–process information Pseudo-filesystem process information masquerading file system


Linux View hardware information commands

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.