How to get hardware info in Linux console/CLI

Sometimes it’s needed to get hardware information on your Linux desktop or server using the command line only. Of course, you can do everything via CLI in Linux. Here just some reminders for myself how to do it.

Most of the information you can get using the following three commands:

  • lspci - list all PCI devices
  • lshw - list hardware
  • dmidecode - DMI table decoder

Using multiple keys to these CLI tools you can get everything you need.

It’s not a full guide. It’s just a list of commands to quickly identify what hardware do you have. I recommend executing all commands with root privileges to get more information.

1. What CPU do I have?

1.1. I think, almost everybody knows the command to get CPU information about your CPU. Here is just a friendly reminder:

# cat /proc/cpuinfo

2. How to get your GPU information?

2.1. A very short information:

# lspci | grep -i –color ‘vga|3d|2d’

01:00.0 VGA compatible controller: ***

2.2.Need more details about your GPU?

# lspci -v -s 01:00.0

2.3. In the case of Nvidia GPUs you can collect some use nvidia-smi tool to get some information:

 

$ nvidia-smi

3. Motherboard

3.1. If you need just a model name:

#dmidecode -s baseboard-product-name

3.2. If you’re too lazy to google your motherboards specs, you can do it via the command below:

# dmidecode -t baseboard

4. RAM

Everybody knows **free** utility. It’s one of the easiest ways to see how many free or used memory you have. To determinate what actually RAM do you have you can use ‘dmidecodeorlshw` utilites.

4.1. dmidecode:

# dmidecode –type 17

4.2. lshw:

# lshw -short -C memory

5. How to get your HDD or SSD hardware info?

For Linux, it doesn’t matter you’ve got SSD or HDD. To get their hardware information such a serial or model number, configuration and capabilities you can use the same software.

5.1. hdparm - get/set SATA/IDE device parameters

# hdparm -I /dev/sda

5.2. If you need to know more about your storage controllers and storage devices, just type the following command:

# lshw -class disk -class storage

6. Network Controllers Info (NIC)

Last but not least, there are two commands to get the information about your NICs.

6.1. lspci:

# lspci | egrep -i –color ‘network|ethernet’

6.2.  lshw:

# lshw -class network

 

Tags

.net .net-framework .net-framework-3.5 agile ajax ajax-control-toolkit ampq ansible apache asp.net asp.net-mvc axum bash benchmark blog blog-engine bootstrap buildout c# cache centos chrome ci cinder ckan cli cloud codeplex community debugger deface development-environment devstack devtime django dlr dns docker dockerimage dos easy_install elmah encoding environment-variables error event events exception exceptions fabrik firefox foreach forms gae gcc git github go google google-app-engine hack hacked hardware headless horizon html hugo iaas ienumerable iis internet iptables iron-python ironic iscsi java-script javascript jenkins jquery js kharkivpy kombu kvm kyiv lettuce libvirt linux lio loci logging mac-os mercurial microsoft microsoft-sync-framework mobile mono ms-office msbuild networking news nginx offtopic open-xml opensource openstack openvswitch os packages paraller-development patterns--practices php pika pip pnp podcast popup postgresql profiler project protocols pycamp pycharm pycon pykyiv pylint pypi python python-3 qcow quantum qumy rabbitmq rar react refactoring rfc rhel search-engine security selenium server shell silverlight socket source-control sourcegear-vault sql sql-server sql-server-express sqlalchemy ssh svg tests tgt tipfy tornado typescript uapycon ui uneta unit-tests usability virtualenv visual-studio vm vue.js vuejs web-development web-server web-service webpack windows windows-live word-press x32 x64 xcode xml xss xvfb интернет-магазин книги

Recent posts

Docker Image Collection

Not a DNS Server for Libvirt

Diskimage-builder in Docker

Everything as a Code

Vue.js, global variables and TypeScript


Archives

2019 (19)
2018 (2)
2017 (3)
2016 (2)
2015 (3)
2014 (5)
2013 (17)
2012 (22)
2011 (35)
2010 (25)
2009 (35)
2008 (32)
2007 (2)