171

I used a system information utility to take the model number of a system, and also of the motherboard.

DMI System Manufacturer     LENOVO
DMI System Product          2306CTO
DMI System Version          ThinkPad X230
DMI Motherboard Product     2306CTO  

Is there a way to get model number, in this case 2306CTO, in Linux?

5
  • 2
    Take a look this
    – Achu
    May 14, 2013 at 8:59
  • 2
    For clarity it seems you're interested in hardware product, not specifically the motherboard. For example, "ThinkPad X230" is a type of computer not motherboard.
    – Bratchley
    May 14, 2013 at 10:45
  • 1
    You can also get some info without extra packages by running dmesg command or checking /var/log/dmesg* . Feb 24, 2019 at 19:32
  • It would be nice to know what 'System Information Utility' you used.
    – Time4Tea
    Apr 11, 2020 at 7:41
  • Try: cat /sys/devices/virtual/dmi/id/{sys_vendor,product_{family,version,name},bios_version} Sep 1 at 15:25

10 Answers 10

199

using the dmidecode | grep -A3 '^System Information' command. There you'll find all information from BIOS and hardware. These are examples on three different machines (this is an excerpt of the complete output):

System Information
    Manufacturer: Dell Inc.
    Product Name: Precision M4700

System Information
    Manufacturer: MICRO-STAR INTERANTIONAL CO.,LTD
    Product Name: MS-7368

System Information
    Manufacturer: HP
    Product Name: ProLiant ML330 G6
5
  • 40
    FWIW, it's probably better to get in the habit of filtering for particular DMI types rather than using grep. For overall hardware model that would be dmidecode -t1. That way you have a simplistic way of pulling data out of dmidecode and just need to remember common DMI types. Habit becomes really useful when examining RAM installs (dmidecode -t17) when grep can make some really ugly output if you key off the wrong data. Plus, the output of -t is more complete
    – Bratchley
    May 14, 2013 at 10:49
  • @JoelDavis, I was not aware of those options before. I will use them. Thanks.
    – eppesuig
    May 14, 2013 at 12:30
  • 21
    Note: needs root. If you want all the info you have permissions for under the current user, use: cat /sys/devices/virtual/dmi/id/* (and it does allow you to get the model name and the sort using a normal user)
    – qwertzguy
    Jan 22, 2015 at 4:58
  • 1
    Piping the output of dmidecode without arguments to grep is interesting, but not the most efficient means of getting the information. dmidecode can print exactly what the OP is asking for by specifying the 'system-product-name' keyword string: sudo dmidecode -s system-product-name
    – cjac
    Nov 21, 2016 at 21:43
  • I think it's worth noting that older systems don't have flags available on dmidecode, nor even a man page. The answer above is the most Linux-portable answer here, I think. The -t and -s flags are useful on newer systems for sure.
    – user233770
    Jun 20, 2018 at 20:16
47

Try sudo dmidecode -t baseboard for full information on the DMI table contents relevant to your baseboard, in a human readable form. For just the System Product Name, you can use either (type dmidecode -s to get a list of strings keywords):

sudo dmidecode -s system-product-name
sudo dmidecode -s baseboard-product-name

Other relevant options for motherboard info are

sudo dmidecode -s system-version
sudo dmidecode -s baseboard-version
sudo dmidecode -s system-manufacturer
sudo dmidecode -s baseboard-manufacturer

Try sudo dmidecode -s for a full list of system DMI strings available.

35

For the record, much of this information is available under /sys/devices/virtual/dmi/id on modern Linuces (ie, since at least 2011), and much if it- notably, not including serial numbers- is readable by regular users. To answer the original poster's question, product_name is the file that contains the system's model name.

bios_date
bios_vendor
bios_version
board_asset_tag
board_name
board_serial
board_vendor
board_version
chassis_asset_tag
chassis_serial
chassis_type
chassis_vendor
chassis_version
modalias
power
product_name
product_serial
product_uuid
product_version
smbios_version
subsystem
sys_vendor
uevent

And here would be a handy-dandy script that any user could run, to display the goodness:

#!/bin/bash

cd /sys/devices/virtual/dmi/id/
for f in *; do
        printf "$f "
        cat $f 2>/dev/null || echo "***_Unavailable_***"
done

No filenames have spaces in them, so this information is easily manipulated by utilities such as awk, for your own nefarious purposes!

5
  • Great, that's great with linux-based most of the if you don't find a tool the stuff you need (OS, hardware info) is somewhere in /sys or /proc. Thanks Dec 9, 2014 at 15:36
  • 3
    Awesome! A solution that works for non-root!
    – qwertzguy
    Jan 22, 2015 at 5:05
  • 3
    Note that this dmi information may only be applicable to Intel-based PCs. I have a network device that is driven by a Linux-based ARM computer, and neither dmicode or the path in /sys is available to it.
    – Mike S
    May 19, 2016 at 21:25
  • You could look at /sys/firmware/devicetree/base/model for ARM which gives e.g. Raspberry Pi Zero W Rev 1.1 Sep 5, 2022 at 12:49
  • Or simply: grep . /sys/devices/virtual/dmi/id/* Or, same with pretty print: grep . /sys/devices/virtual/dmi/id/* | sed 's@.*/\([^/:]\+\):@\1 @;s/^\(.\{20\}\) */\1/' Sep 1 at 15:15
18

On modern Linux systems, you can easily do things like this as any user:

cat /sys/devices/virtual/dmi/id/sys_vendor

cat /sys/devices/virtual/dmi/id/product_name

This also works well for CoreOS, which does not ship with dmidecode.

Note: This has been mentioned in other answers/comments, but is hopefully more visible here, as this is a much easier method than using dmidecode.

0
10

Everyone here talks about the great dmidecode command and the -t parameter, but with sudo lshw -short you also get easily the product name and model:

$ sudo lshw -short
H/W path       Device     Class          Description
====================================================
                          system         UX303UB (ASUS-NotebookSKU)
/0                        bus            UX303UB

Other great commands for getting hardware info:

  • inxi [-F] All-in-one and friendly, written in Perl. Try inxi -SMG -! 31 -y 80
  • lscpu # Better than /proc/cpuinfo
  • lsusb [-v]
  • lsblk [-a] # Better than df -h. Block Device Information.
  • sudo hdparm /dev/sda1
2
  • Aside from lshw, none of those commands answer the question the OP asks. They're highly useful utilities, yes, but not exactly in the scope of the question...
    – Shadur
    Jan 10, 2017 at 16:08
  • 3
    @shadur why you downvote me? I answer the question in a way any other answer do, and then just offer extra useful information, what is pretty command on any great post.
    – Pablo A
    Jan 10, 2017 at 16:17
8

Try:

sudo dmidecode -s baseboard-product-name
6

You can use:

dmidecode -t 1

Which outputs something like:

System Information
    Manufacturer: Dell Inc.
    Product Name: PowerEdge R210 II
    Version: Not Specified
    Serial Number: 1234ABC
    UUID: ABABABAB-0101-2323-5A5A-ABCDEF123456
    Wake-up Type: Power Switch
    SKU Number: Not Specified
    Family: Not Specified
4

The system information tool inxi shows the information cleanly and without having to do all the checks of dmidecode / /sys manually. See the man page for full feature list.

It supports systems with and without /sys, though with /sys data, you don't need to be root to get the full hardware output, with dmidecode you do.

$inxi -M
Machine:   Device: desktop Mobo: ASRock model: A770DE+
           BIOS: American Megatrends v: P1.70 date: 09/07/2010

You can, as root, also force the data to come from dmidecode:

#inxi -! 33 -Mxxx ## inxi 2.3.56 and older
#inxi --dmidecode -Mxxx ## inxi 2.9 and newer
Machine:   Device: desktop Mobo: ASRock model: A770DE+
           BIOS: American Megatrends v: P1.70 rv 8.14 date: 09/07/2010 rom size: 1024 kB

inxi is available in the repos of most GNU/Linux distributions, or is installable directly by just grabbing the script and installing it.

Sample of the basic output mode (-b)

$inxi -bxx
System:    Host: my-box Kernel: 4.6-6.1-liquorix-686-pae i686 (32 bit gcc: 5.4.1)
           Desktop: Xfce 4.12.3 (Gtk 2.24.30) dm: lightdm
           Distro: Debian GNU/Linux 7.0
Machine:   Device: desktop Mobo: ASRock model: A770DE+
           BIOS: American Megatrends v: P1.70 date: 09/07/2010
CPU:       Dual core AMD Athlon 64 X2 5000+ (-MCP-) speed/max: 1000/2600 MHz
Graphics:  Card: NVIDIA GT218 [GeForce 210] bus-ID: 02:00.0 chip-ID: 10de:0a65
           Display Server: X.Org 1.19.0 driver: nvidia
           Resolution: [email protected], [email protected]
           GLX Renderer: GeForce 210/PCIe/SSE2/3DNOW!
           GLX Version: 3.3.0 NVIDIA 340.101 Direct Rendering: Yes
Network:   Card: Intel 82574L Gigabit Network Connection
           driver: e1000e v: 3.2.6-k port: c800
           bus-ID: 01:00.0 chip-ID: 8086:10d3
Drives:    HDD Total Size: 1080.2GB (36.8% used)
Info:      Processes: 313 Uptime: 26 days Memory: 4457.2/8094.0MB
           Init: systemd v: 232 runlevel: 5 default: 3
           Gcc sys: 6.3.0 alt: 4.0/4.2/4.4/4.5/4.6/4.7/4.8/4.9/5
           Client: Shell (bash 4.4.51 running in xfce4-terminal) inxi: 2.3.8

New output format in inxi 3.x

inxi -bxxxzy80
System:
  Host: yawn Kernel: 4.17.0-10.1-liquorix-amd64 x86_64 bits: 64 compiler: gcc 
  v: 7.3.0 Desktop: Xfce 4.12.4 tk: Gtk 2.24.31 info: xfce4-panel wm: xfwm4 
  dm: lightdm 1.18.3 Distro: Debian GNU/Linux buster/sid 
Machine:
  Type: Desktop System: Gigabyte product: X470 AORUS ULTRA GAMING v: N/A 
  serial: <filter> 
  Mobo: Gigabyte model: X470 AORUS ULTRA GAMING-CF v: x.x serial: <filter> 
  UEFI [Legacy]: American Megatrends v: F2 date: 03/14/2018 
CPU:
  6-Core: AMD Ryzen 5 2600 type: MT MCP arch: Zen speed: 2300 MHz 
  min/max: 1550/3400 MHz 
Graphics:
  Card-1: NVIDIA GT218 [GeForce 210] vendor: Gigabyte driver: nvidia 
  v: 340.107 bus ID: 09:00.0 chip ID: 10de:0a65 
  Display: x11 server: X.Org 1.20.0 driver: nvidia 
  resolution: 1280x1024~60Hz, 1280x1024~60Hz 
  OpenGL: renderer: GeForce 210/PCIe/SSE2 v: 3.3.0 NVIDIA 340.107 
  direct render: Yes 
Network:
  Card-1: Intel I211 Gigabit Network driver: igb v: 5.4.0-k port: f000 
  bus ID: 06:00 chip ID: 8086:1539 
  Card-2: Apple Ethernet Adapter [A1277] type: USB driver: asix bus ID: 1:13 
  chip ID: 05ac:1402 
Drives:
  Local Storage: total: 1.08 TiB used: 496.05 GiB (45.0%) 
Info:
  Processes: 339 Uptime: 3d 6h 22m Memory: 31.43 GiB used: 4.04 GiB (12.8%) 
  Init: systemd v: 239 runlevel: 5 Compilers: gcc: 8.1.0 alt: 5/6/7/8 
  Shell: bash v: 4.4.23 running in: xfce4-terminal inxi: 3.0.20
3
  • 1
    Looks nice. I'm wondering if there's a way that this tool will return system or board serial numbers? Then you don't need root for just about any system introspection like this. (I'm guessing the answer is "no").
    – Mike S
    Aug 13, 2018 at 0:29
  • Prior to a change in the linux kernel, which creates the /sys file system, you could get the serial numbers for these things without being root, but after the change, which is totally outside of inxi's control, you need to be root, and there is no way to work around that. Obviously that was a silly decision and a regression based on some bad idea someone had, but there's nothing inxi can do to resolve that problem. sudo inxi -Mxxx returns serials always. On some systems no sudo is required, depends on the kernel version I think.
    – Lizardx
    Aug 13, 2018 at 3:26
  • Note that inxi 3.0 and newer do not use -! 33 anymore, they use --dmidecode
    – Lizardx
    Aug 13, 2018 at 3:27
3

Or this

lshw -short | grep system
1
  • On my Dell server, it does not give the model number of the motherboard, only of the system.
    – Mike S
    Oct 11, 2022 at 17:07
1
# dmidecode -t baseboard

if supported by the manufacturer, will give you the information.

dmidecode is a tool for dumping a computer's DMI (some say SMBIOS) table contents in a human-readable format. This table contains a description of the system's hardware components, as well as other useful pieces of information such as serial numbers and BIOS revision. Thanks to this table, you can retrieve this information without having to probe for the actual hardware. While this is a good point in terms of report speed and safeness, this also makes the presented information possibly unreliable.

1
  • grep needs quotes.
    – user233770
    Jun 20, 2018 at 20:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .