Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get hardware information on Linux/Unix?

How I can get hardware information from a Linux / Unix machine. Is there a set of APIs?

I am trying to get information like:

  • OS name.
  • OS version.
  • available network adapters.
  • information on network adapters.
  • all the installed software.

I am looking for an application which collects this information and show it in a nice format. I have used something similar with the "system_profile" command line tool for Mac OS X. I was wondering if something similar is available for Linux as well.

like image 237
Unicorn Avatar asked Nov 13 '09 07:11

Unicorn


3 Answers

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.

like image 121
AttishOculus Avatar answered Sep 22 '22 03:09

AttishOculus


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

like image 35
Ei Maung Avatar answered Sep 23 '22 03:09

Ei Maung


There is a bash command lshw - list hardware

like image 35
Mojo Risin Avatar answered Sep 21 '22 03:09

Mojo Risin