Getting information on a machine's hardware in Linux

28,923

Solution 1

If your system supports a procfs, you can get much information of your running system. Its an interface to the kernels data structures, so it will also contain information about your hardware. For example to get details about the used CPU you could cat /proc/cpuinfo For more information you should see the man proc.

More hardware information can be obtained through the kernel ring buffer logmessages with dmesg. For example this will give you a short summary of recently attached hardware and how it is integreated in the system.

These are some basic "interfaces" you will have on every distribution to obtain some hardware information.

Other 'small' tools to gather hardware information are:

  • lspci - PCI Hardware
  • lsusb - USB Hardware

Depending on your distribution you will also have access to one of these two tools to gather a detailed overview of your hardware configuration:

  • lshw
  • hwinfo (SuSE specific but availible under other distributions also)

The "gate" to your hardware is thorugh the "Desktop Management Interface" (-> DMI). This framework will expose your system information to your software and is used by lshw for example. A tool to interact directly with the DMI is dmidecode and availible on the most distributions as package. It will come with biosdecode which shows you also the complete availbile BIOS informations.

Solution 2

To display a nice overview of my hardware, I use lshw -short, best run (as root). You can just run lshw plain of course, but I prefer the conciseness that the -short option offers.

To check my HDD usage, I use df --human-readable, which should be available by default on your system (unlike lshw).

Also, have a look at checking hardware on linux.

Solution 3

You can use 'lshw'. Install it using 'sudo apt-get install lshw' on Debian and derivatives. There's even a graphical version called lshw-gtk.

Solution 4

This is highly variable between unix variants. Check the column for your variant on the Rosetta Stone for Unix.

Under Linux, lshw collects a lot of information scattered in various text files under /proc and /sys.

Solution 5

for cpu info

cat /proc/cpuinfo

for disk usage

df -h

for pci cards and buses

lspci

you may find lshw useful

if you need usb devices

lsusb

Share:
28,923

Related videos on Youtube

Vincent
Author by

Vincent

nothing yet

Updated on September 17, 2022

Comments

  • Vincent
    Vincent over 1 year

    How can I check what hardware I have? (With BIOS version etc.)

    • jlliagre
      jlliagre over 13 years
      On what Operating System ? There is no standard command so anything would be more or less distribution specific.
    • xenoterracide
      xenoterracide over 13 years
      @jiliargre I wouldn't say distribution specific but certainly OS, Linux and BSD probably greatly vary here.
    • jlliagre
      jlliagre over 13 years
      And Solaris, HP-UX, AIX, whatever too. That's what I meant.
    • tshepang
      tshepang over 13 years
      @jll It's tagged [linux], so I suppose...
  • Patkos Csaba
    Patkos Csaba over 13 years
    hwinfo is another nice utility and lm-sensors for temperatures.
  • tshepang
    tshepang over 13 years
    @Patkos It seems sudo hwinfo --short is the equivalent, and it displays IMO prettier output. Unfortunately skips some interesting info (EG, it doesn't display HDD partition sizes).
  • ivanivan
    ivanivan about 7 years
    lshw -html > file.html generates a nice HTML formatted version. I find it much easier to go through it in a browser than a console window.
  • ivanivan
    ivanivan about 7 years
    it was an option i had to specifically enable when i built it using gentoo back in 2002-3ish...