What hardware is in my computer linux

How can I find the hardware model in Linux?

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 

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.

You can also get some info without extra packages by running dmesg command or checking /var/log/dmesg* .

10 Answers 10

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 

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

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)

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

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.

Читайте также:  Install kali linux arm

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.

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!

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

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.

You could look at /sys/firmware/devicetree/base/model for ARM which gives e.g. Raspberry Pi Zero W Rev 1.1

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

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 .

Читайте также:  Grep and cat in linux

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

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 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.

sudo dmidecode -s baseboard-product-name 

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 

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: 1280x1024@60.02hz, 1280x1024@60.02hz 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: Mobo: Gigabyte model: X470 AORUS ULTRA GAMING-CF v: x.x serial: 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 

Источник

Оцените статью
Adblock
detector