When you buy a new PC, laptop or server and install a Linux you want to know what hardware is actually in the Linux box and more importantly which piece of hardware is supported by the kernel out of the box and which needs special tweaking with modules to get it work. Here is a list of commands which should help you to troubleshoot your hardware and find some information about it. This is not a ultimate troubleshooting guide but certainly will serve as a good starting point.

NOTE: some commands may not be avaiable for your platform after default installation as well as some commands may be distribution specific only.

What hardware is in my Linux box:

$ lspci


# dmidecode

What hardware is using which module.

NOTE:Root permissions are needed to execute this command:

# lspci -v


# lspci -vvv


# hardinfo


$ hardinfo ( GUI )


# lshw


# lshw-gtk  ( GUI )


# hwinfo


Retrieve BIOS information:

# biosdecode

Retrieve BIOS vendor information:

# dmidecode -s  bios-vendor

Retrieve information about your motherboard only:

# dmidecode --type baseboard

What USB devices are plugged in:

$ lsusb

Get USB disk device files

ls -la /dev/disk/by-id/usb-*

Hard drive model

hdparm -I /dev/sdx

Hard drive speed

hdparm -tT /dev/sdx

Graphic card information:

$ lspci | grep VGA

Check the size of the hard drive and partitions

Check the size of the hard drive and what hard drives are available in the system.

This command will also list USB drives and sticks. You need a root permissions to execute this command:

# fdisk -l | grep GB

Check what partitions and file system is in use on my hard drives:

# fdisk -l

Locate CD/DVD-ROM device file:

$ wodim --devices


$ wodim --scanbus


What modules are currently loaded:

$ lsmod

get a information about any particular module:

$ /sbin/modinfo module_name

remove modules:

# modprobe --remove module_name

load a modules to the kernel:

# modprobe module_name

What hardware is using which module.

NOTE:Root permissions are needed to execute this command:

# lspci -v


# lspci -vvv

Check for PCMCIA cards:

# lspcmcia

Processor type and socket

$ cat /proc/cpuinfo


# dmidecode --type 4

Is my processor using 32 or 64 bit instruction set:

$ cat /proc/cpuinfo | grep flags | grep lm

if you get some output you have 64 bit if no output is presented you are using 32 or even 16 bit CPU. NOTE: grep command looks for lm flag.

Retrieve CPU / Processor socket type:

x86info -a 2> /dev/null | grep Connector | uniq


How much RAM is installed in my Linux and how much of it is in use ( mega bytes ).

It will also include swap memory:

$ free -m


$ top


$ cat /proc/meminfo

Detect number of RAM slots used, speed, and size:

# lshw -C memory -short


# dmidecode -t 17

Sound Card

Check sound card settings. This command will reveal whether your sound card is installed and what modules are in use:

$ cat /dev/sndstat

Available wireless cards:

$ iwconfig

What speed is set to FANs:

$  cat /proc/acpi/ibm/fan


Get a battery information on your laptop:

$ powersave -b

List Plug and Play BIOS device

# lspnp
FIND LATEST LINUX JOBS on LinuxCareers.com
Submit your RESUME, create a JOB ALERT or subscribe to RSS feed.
Subscribe to NEWSLETTER and receive latest news, jobs, career advice and tutorials.
Get extra help by visiting our LINUX FORUM or simply use comments below.

You may also be interested in: