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?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
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
Method 2
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.
Method 3
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!
Method 4
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.
Method 5
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. Tryinxi -SMG -! 31 -y 80lscpu# Better than /proc/cpuinfolsusb[-v]lsblk[-a] # Better than df -h. Block Device Information.sudo hdparm /dev/sda1
Method 6
Try:
sudo dmidecode -s baseboard-product-name
Method 7
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
Method 8
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: <a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4677747e763e777674720670766876742e3c">[email protected]</a>, <a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7a4b48424a024b4a484e3a4c4a544a481200">[email protected]</a>
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
Method 9
Or this
lshw -short | grep system
Method 10
# 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.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0