What Hardware Do I Have?

Often you may not necessarily know what kind of hardware you have—you may have a no-name box from a smaller company or a used machine. This month, I present the tools you can use to find out what you have installed.

First up is lshw. This utility LiSts HardWare (lshw). If you run it as a regular user, it actually warns you to run it as root. So go ahead and run sudo lshw. You should see screens of information for your system. The first section will be general information and should look something like this:

jbernard-eeepc            
    description: Notebook
    product: 700
    vendor: ASUSTeK Computer INC.
    version: 0129
    serial: EeePC-1234567890
    width: 32 bits
    capabilities: smbios-2.5 dmi-2.5 smp-1.4 smp
    configuration: boot=normal chassis=notebook 
    ↪cpus=1 uuid=XXXXXX-XXXXX-XXXXX-XXXXX

This is what I get when I run it on my little ASUS EeePC. Right away you can find the manufacturer of this little beast (ASUSTeK), the BIOS version (0129), and the fact that it's a 32-bit machine with one CPU. More information is broken down into the following categories:

core
   firmware - motherboard and BIOS information
   cpu - CPU information
      cache - cache information
   memory - memory information
      bank - specific bank memory information
   pci - PCI bus information
      display - PCI display adapter
      multimedia - PCI audio adapter
      pci - other PCI devices
      network - PCI network adapter
   usb - USB devices
   ide - IDE information
      disk - individual disks
         volume - volumes on this disk

For an idea on how much information is available, the main memory section shows this about my EeePC:

*-memory
     description: System Memory
     physical id: 1f
     slot: System board or motherboard
     size: 512MiB
   *-bank
        description: DIMM DDR2 Synchronous 400 MHz (2.5 ns)
        product: PartNum0
        vendor: Manufacturer0
        physical id: 0
        serial: SerNum0
        slot: DIMM0
        size: 512MiB
        width: 64 bits
        clock: 400MHz (2.5ns)

This utility is basically an all-in-one tool that spits out everything on your system in one go. But, what if you want information only about specific subsystems in your machine? An entire suite of utilities exists for this, and they might be more useful when you need some specific piece of information or want to do some system querying in a script.

You may want to look at the CPU. The lscpu utility provides output similar to the following:

Architecture:          i686
CPU op-mode(s):        32-bit
CPU(s):                1
Thread(s) per core:    1
Core(s) per socket:    1
CPU socket(s):         1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 13
Stepping:              8
CPU MHz:               571.427

From this, you can see the manufacturer, whether it's 32-bit or 64-bit, the exact version and model, as well as the current CPU frequency.

If you want to know whether your video card is supported by X11, or whether you need to find a third-party driver, you can use lspci. This utility gives a list of all the devices plugged in to your PCI bus. The output looks something like this:

00:02.0 VGA compatible controller: Intel Corporation 
 ↪Mobile 915GM/GMS/910GML Express Graphics Controller (rev 04)
00:02.1 Display controller: Intel Corporation 
 ↪Mobile 915GM/GMS/910GML Express Graphics Controller (rev 04)

This information shows that the video controller in my EeePC is an Intel controller. So, if you wanted, you now could search Google with this information to learn about your video card and how best to configure it. If you want to see what USB devices are on your system, use lsusb. On my EeePC, I have an SD card installed, and it shows up as this:

Bus 001 Device 002: ID 0951:1606 Kingston Technology 

If you're interested in the disk subsystem, you can find out what your system has with the blkid utility. This utility prints out all the available filesystems, with the following output format:

/dev/sda1: UUID="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" TYPE="ext2" 
/dev/sda2: UUID="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" TYPE="swap" 
/dev/sda3: UUID="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" TYPE="ext2" 
/dev/sdb1: UUID="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" TYPE="ext2" 

With this utility, you can learn what devices are available and what filesystems are being used on them. The associated UUIDs also are available if you want to use them in the entries in /etc/fstab.

Now that you know what kind of hardware you have on your system, the last thing to check is to see whether your kernel actually is using the available hardware. On most modern distributions, the kernel is compiled to use modules. You can check to see which modules are loaded by using the lsmod command. You will get a list that looks like this:

agpgart                31788  2 drm,intel_agp
lp                      7028  0 
video                  17375  1 i915
output                  1871  1 video

You can see that the agpgart module has a size of 31788 bytes and is used by the drm and intel_agp modules.

Now, hopefully, you can configure and optimize your hardware so that you get the most out of it. If you find other utilities not covered here, I would love to hear about them.

Photo Credit: © Nenov Brothers/Shutterstock
______________________

Joey Bernard has a background in both physics and computer science. This serves him well in his day job as a computational research consultant at the University of New Brunswick. He also teaches computational physics and parallel programming.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

As usual you had given a

Adam Tech's picture

As usual you had given a wonderful informative words. Well hardware parts like brass standoff make any difference in performance.

I use CPU-G on Ubuntu to get

spotht's picture

I use CPU-G on Ubuntu to get hardware information.

http://wiki.hardinfo.org/Home

Anonymous's picture

lshal - List HAL

Anonymous's picture

lshal - List HAL devices
Gives a lot of useful information as well.

RAM Type

jaqian's picture

On windows I can use CPU-Z and it will tell what type of RAM I need if I want to add more. Is there a command on Linux that will tell me same?

what about 'sensors' ?? Not

Anonymous's picture

what about 'sensors' ??
Not that most people care what their fan speed or temperature is... but sometimes the sensors aren't calibrated correctly or found correctly and they actually have to be found with 'sensors-detect' and manually added.

Yeah, "hwinfo" is the way to

Anonymous's picture

Yeah, "hwinfo" is the way to go in OpenSUSE.

great info!

tgerhard60's picture

This is going to come in handy as I try to figure out how to get my audio to work in Puppy 4.3.1.

Thanks for this!!

Well timed. Just trying to

Anonymous's picture

Well timed. Just trying to figure this out this morning! Thanks.

sdfsdf

fsdfdsfsdf's picture

welcome to :
===== http://xrl.us/bh729m ======
This is a shopping paradise
Special!!
Smful short_t-shirt_woman $15

ed hardy short_tank_woman $16

Sandal $32

christian louboutin $80

Sunglass $15

COACH_Necklace $27

╭⌒╮⌒╮.’,”’,,’,.”,,’,”,.
╱◥██◣”HOES 35$o’,”’,,’,.”.”,,’,.
|田|田田│ ”,,’,.’,”’t-shirt 14$,,’,.”
╬free shipping╬╬╬╬╬╬_

Sysinfo

Ewen's picture

Sysinfo gives a GUI view of system info as well.

lspci & /proc/cpuinfo

praxis22's picture

It's nice to have that sort of stuff but for most I suspect lspci & lsusb will suffice, especially if they just want to know what chip they need to find a driver for.

cat /proc/cpuinfo will tell you what your processor is and what it's capable of, and free -m will tell you roughly how much RAM you have, (top left figure) in Megabytes.

You can also use

Matt Shields's picture

Another great utility is dmidecode. This will give you a ton of information about your machine

Also lshw-gui

ArthurC's picture

The lshw-gui adds a nice gui to the lshw command.

I agree, this is great

Cindy's picture

I agree, this is great !

http://www.tendances-de-mode.com/en/

openSUSE Alternative

bobbymcgill's picture

You can run "hwinfo" as root on openSUSE for similar information. (Not sure about other distros)

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix