How do I get hardware information on Linux/Unix? How do I get hardware information on Linux/Unix? unix unix

How do I get hardware information on Linux/Unix?


If you need a simple answer, use:

  • cat /proc/cpuinfo
  • cat /proc/meminfo
  • lspci
  • lsusb

and harvest any info you need from the output of these commands. (Note: the cut command may be your friend here if you are writing a shell script.)

Should you need more detail, add a -v switch to get verbose output from the lspci and lsusb commands.

If what you are looking for is a more feature-complete API, then use HAL, though that may be an overkill for what you are trying to build.


If you are looking for a tool that show System Information, the GUI tool like HardInfo would useful for you.

In Ubuntu, you can install HardInfo like this...

sudo apt-get install hardinfo

Cheers


There is a bash command lshw - list hardware