Archive for April, 2011

Commands to check hardware

April 7, 2011 2 comments

The cool thing about linux is, everything in linux is a file. Hard disk, compact disk, memory, virtually anything is a file.

Dig the right files and you will get right info

dmidecode gives a detailed list of hardware info ( one awesome command). If you are looking something specific try grep.

You can find out your hardware such as:
* IPMI Device
* Type of memory and speed
* Chassis Information
* Temperature Probe
* Cooling Device
* Electrical Current Probe
* Processor and Memory Information
* Serial numbers
* BIOS version
* PCI / PCIe Slots and Speed
* Much more

General syntax is:

dmidecode –type {KEYWORD/NUMBER}

Keyword and numbers can be:

Keyword                   Number


bios                    0, 13

system                1, 12, 15, 23, 32

baseboard          2, 10, 41

chassis               3

processor           4

memory              5, 6, 16, 17

cache                 7

connector            8

slot                     9

For BIOS info type

dmidecode –type bios

dmidecode –type 0

For Motherboard info type

dmidecode –type baseboard

For processor related info type

dmidecode –type processor

For Manufacturer,Model and serial number

dmidecode –type system

For more info dig into man page

man dmidecode

Specific commands

0. CPU specifications

cat /proc/cpuinfo

1. kernel info

uname -a

kernel version

uname -r

3. pci cards

cat /proc/pci

4. Memory(RAM) and swap information

cat /proc/meminfo

free -m

5.Hard drives partitions

fdisk -l

6. free/used drive space

df -h

7. Disk usage by current directory and all subdirectories

du | less

another command is du -sh /* to see top level directory wise disk usage

8. dmesg to view the kernel ring buffer (error messages)

dmesg | less

dmesg | egrep ‘(SCSI|scsi0|ide0|hda|sda|serio|mice|eth0|eth1)’

9.some other commands

lspci ( lists pci device)
lsusb ( lists usb device)

Categories: Linux