146

I have a notebook HP Pavilion dm4 running Ubuntu 12.04 and I'm trying to determine the model number (like HP Pavilion dm4-2015dx or HP Pavilion dm4-2033cl, etc). There's no such information on notebook's body as suggested on HP's website on Option 1.

I tried to use lshw and dmidecode, but couldn't find. Maybe I should use an especific option but all the information I found is for Windows, nothing for linux.

There is a way to show this information on linux?


sudo dmidecode |grep Version

shows

Version: Intel(R) Core(TM) i5 CPU M 460 @ 2.53GHz


Here's the System Information part of sudo dmidecode | less

System Information
        Manufacturer: Hewlett-Packard
        Product Name: HP Pavilion dm4 Notebook PC     
        Version: 058A120000242B10000020100
        Serial Number: 5CA1062FYJ
        UUID: E4BD398B-4D9E-BC63-1A03-099330BF5443
        Wake-up Type: Power Switch
        SKU Number: XZ299UAR#ABA
        Family: 103C_5335KV G=N L=CON B=HP S=PAV        
:
muru
  • 207,228
Eduardo
  • 1,667

6 Answers6

202

To see your model number, open a Terminal with Ctrl + Alt + T and type:

sudo dmidecode | grep Version | sed -n '2p'

or alternatively type:

sudo dmidecode | grep 'SKU Number' | head -1

to see your SKU Number.


If you want to see a more detailed view of your System information type:

sudo dmidecode | grep -A 9 "System Information"

or

sudo dmidecode | less

and use the    key to go to the section System Information.


enter image description here

efthialex
  • 3,941
28

I guess this command will help:

sudo dmidecode | grep 'SKU Number' | head -1

This will return your laptop's model name:

sudo dmidecode -s system-product-name

This will return your serial number:

sudo dmidecode -s system-serial-number

-s is a keyword argument. Run man dmidecode to find all the available options.

Xerz
  • 4,591
19

Use dmidecode

$ sudo dmidecode -t 1

#dmidecode 3.0
Getting SMBIOS data from sysfs.
SMBIOS 2.6 present.

Handle 0x0001, DMI type 1, 27 bytes
System Information
       Manufacturer: Dell Inc.
       Product Name: Latitude E6410
       Version: 0001
       Serial Number: DZX46BS
       UUID: 4C4C4544-005A-5810-8034-C4C04F364253
       Wake-up Type: Power Switch
       SKU Number:  
       Family: Not Specified
GuGu
  • 191
  • 1
  • 3
3

On my T430 I have to take out the battery and there is this little sticker that tells me exactly what I want to know. It's not where Lenovo says it is (on top of the battery), but there it is. Might be easier than doing it from the command line if in fact you have such a sticker.

Timon
  • 33
  • 3
0

I was also able to get my model number within neofetch information, specifically under 'Host' info.

neofetch

You may need to install neofetch to run this. It can be done by

sudo apt install neofetch 
0

I needed to find the hardware model for automated logging purposes where using sudo (and thus using dmidecode) was not an option.

I knew that neofetch could get this without sudo so I took a look in the source code (in the get_model() function).

The following works for me on a 22.04 machine:

cat /sys/devices/virtual/dmi/id/product_version
ThinkPad P14s Gen 2a

See alos:

$ ls -l /sys/devices/virtual/dmi/id/product*
-r--r--r-- 1 root root 4096 May 23 13:54 /sys/devices/virtual/dmi/id/product_family
-r--r--r-- 1 root root 4096 May 23 08:58 /sys/devices/virtual/dmi/id/product_name
-r-------- 1 root root 4096 May 23 13:54 /sys/devices/virtual/dmi/id/product_serial
-r--r--r-- 1 root root 4096 May 23 13:54 /sys/devices/virtual/dmi/id/product_sku
-r-------- 1 root root 4096 May 23 13:54 /sys/devices/virtual/dmi/id/product_uuid
-r--r--r-- 1 root root 4096 May 23 09:00 /sys/devices/virtual/dmi/id/product_version
htaccess
  • 1,528