Home > Linux > Commands to check hardware

Commands to check hardware

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)

Advertisements
Categories: Linux
  1. April 7, 2011 at 9:29 am

    Thank you imran learnt new stuff please update the blog regularly for us 😉

  2. April 7, 2011 at 10:14 am

    Thanks babloo. Im glade that my blog is of use to you.

  1. No trackbacks yet.

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

%d bloggers like this: