Get Linux Hardware info


Commands that can be used to display hardware information on a Linux machine:

Get information about System CPU:

[root@localhost /]# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 2
Socket(s): 2
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 60
Stepping: 3
CPU MHz: 3599.998
BogoMIPS: 7199.99
Hypervisor vendor: VMware
Virtualization type: full
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 8192K
NUMA node0 CPU(s): 0-3

[root@localhost /]# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 60
model name : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
stepping : 3
microcode : 26
cpu MHz : 3599.998
cache size : 8192 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0

 

List block devices:

[root@localhost /]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 300M 0 part /boot
├─sda2 8:2 0 17.7G 0 part /
└─sda3 8:3 0 2G 0 part [SWAP]
sdb 8:16 0 80G 0 disk
sr0 11:0 1 1024M 0 rom

[root@localhost /]# blkid
/dev/sda2: UUID=”60f74b90-64ce-4106-9a6f-1d7af2653122″ TYPE=”ext4″
/dev/sda1: UUID=”05189744-e506-4278-a318-065a60985dbe” TYPE=”ext4″
/dev/sda3: UUID=”1efbf8bc-bad2-48cb-b370-b313db9d9249″ TYPE=”swap”

 

List USB devices:
[root@localhost /]# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub

Displays available USB controllers, you can use the lsusb command with the -t parameter to view a tree like structure output:

[root@localhost /]# lsusb -t
Bus# 2
`-Dev# 1 Vendor 0x1d6b Product 0x0001
|-Dev# 2 Vendor 0x0e0f Product 0x0003
`-Dev# 3 Vendor 0x0e0f Product 0x0002
Bus# 1
`-Dev# 1 Vendor 0x1d6b Product 0x0002

This info is available from the /proc/bus/usb directory.

 

Display I/O statistics:

[root@localhost /]# iostat
Linux 2.6.32-573.3.1.el6.x86_64 (localhost.localdomain) 05/26/2016 _x86_64_ (4 CPU)

avg-cpu: %user %nice %system %iowait %steal %idle
0.03 0.01 0.08 0.12 0.00 99.76

Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda 3.75 37.38 72.88 10522532 20514916
sdb 0.00 0.01 0.00 3776 0

 

Get information about system memory:

[root@localhost /]# cat /proc/meminfo

[root@localhost /]# free -m
total used free shared buffers cached
Mem: 1869 1561 308 3 408 735
-/+ buffers/cache: 416 1452
Swap: 2047 18 2029
[root@localhost /]#

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s