FAQ: How to retreive hardware manufacturer name, serial numbers, etc. in Linux command line

ibm serial numberQuestion: How can I get information about hardware manufacturer, model name, serial number, BIOS information using Linux command line (CLI)?

Answer: You are welcome to use dmidecode which helps to get information about your system’s hardware as described in your system BIOS. That information typically includes system manufacturer, model name, serial number, BIOS version, asset tag as well as a lot of other details depending on the manufacturer.

Beware that DMI data have proven to be too unreliable to be blindly trusted. Dmidecode does not scan your hardware, it only reports what the BIOS told it to. Dmidecode was first written by Alan Cox and is now being further developed and maintained by Jean Delvare. It is released under the General Public License (GPL).

This tool can be easily downloaded from here (source code) or can be installed as binary package included into repositories of many distributions like Debian, Ubuntu, Gentoo. FreeBSD version is also available. Actualy it is reported that dmidecode works well on the following systems:

  • Linux i386
  • Linux x86_64
  • Linux ia64
  • FreeBSD i386
  • FreeBSD x86_64
  • NetBSD i386
  • OpenBSD i386
  • BeOS i386
  • Cygwin i386
  • Solaris x86 (CVS version)

In Ubuntu (my favourite distro) just execute the following: sudo aptitude install dmidecode (sample output is here).

 
 
» You might also be interested in the following articles:
FAQ: How to scrollback in GNU SCREEN?
Bash shell FAQ
Why and how to migrate to ext4
Google phone (GPhone) rumors
Another 10 good Unix habits to pickup



» Want to stay up to date? Subscribe to our E-MAIL or RSS feed!

7 Responses to “FAQ: How to retreive hardware manufacturer name, serial numbers, etc. in Linux command line”


  1. 1 shirteesdotnet

    Sounds interesting. Ive only been running Ubuntu for about 8 months now… can move around pretty good, but at first couldnt figure out how to run this. I installed it fine in the terminal, and then typed “dmidecode” in the terminal to run it but get this error:

    dmidecode 2.9
    /dev/mem: Permission Denied

    I then did “gksudo dmidecode” and it worked fine.

  2. 2 confiq

    you should use “sudo” instead of “gksudo”.
    gksudo is to ask you in GUI for password, but if you’re in terminal without X you can’t use that command!

  3. 3 artiomix

    Thank you, confiq, that’s what I wanna say :)

  4. 4 mysurface

    lshw does provide quite informative hardware info too, and can generate html format.

    http://linux.byexamples.com/archives/340/how-to-generate-system-hardware-profile-for-your-laptop/
    But recently lshw seems to acting up :(

  5. 5 Bobby0724

    #!/bin/sh
    echo “Getting HW information”
    rm info.txt
    echo “————System Information————————–” >> info.txt
    wget http://mirror.sourceshare.org/savannah/dmidecode/dmidecode-2.10.tar.gz
    tar -zxvf dmidecode-2.10.tar.gz
    cd dmidecode-2.10
    make
    ./dmidecode -t 1 >> ../info.txt
    cd ..
    echo “Hostname: $HOSTNAME” >> info.txt
    echo “Data Collected :” >> info.txt
    date >> info.txt
    echo “” >> info.txt
    echo “————Operating System Information—————-” >> info.txt
    cat /proc/version >> info.txt
    echo “” >> info.txt
    echo “————CPU Information—————————–” >> info.txt
    cat /proc/cpuinfo | grep processor >> info.txt
    cat /proc/cpuinfo | grep name >> info.txt
    cat /proc/cpuinfo | grep MHz >> info.txt
    echo “” >> info.txt
    echo “————Memory Information————————–” >> info.txt
    cat /proc/meminfo | grep MemTotal >> info.txt
    cat /proc/meminfo | grep MemFree >> info.txt
    echo “” >> info.txt
    echo “————Network Information————————-” >> info.txt
    lspci | grep Ethernet >> info.txt
    ifconfig | grep HWaddr >> info.txt
    ifconfig | grep Bcast >> info.txt
    echo “” >> info.txt
    echo “————Disk Information—————————-” >> info.txt
    df -h >> info.txt
    rm dmidecode-2.10.tar.gz
    rm -rf dmidecode-2.10

  6. 6 Deviceback

    Chain Return,vision female strength point army discuss activity again status education engine package lose agent dead face scheme employee representative chair priority car package exactly relevant meal above member partly training membership cover this top however hot in seem question long point impose conference colleague mass point exist force figure south examine story serious severe purpose thin factor yeah emerge exist deny suppose solicitor result latter tour simple man funny appeal occasion help down hot most file propose face how point park procedure expenditure liability

  7. 7 Roger Pedlow

    I was reading something else about this on another blog. Interesting. Your perspective on it is diametrically contradicted to what I read earlier. I am still contemplating over the diverse points of view, but I’m leaning to a great extent toward yours. And regardless, that’s what is so superb about contemporary democracy and the marketplace of ideas on-line.

Leave a Reply




Friendly Sites:Who is behind Linux Screw?
Aspiring Sysadmin | GeekyBits³ | Bash Cures Cancer | TOTMS
Linux Operating System | Small Linux Deployments | My SysAd Blog
The Danesh Project | ZEPY | Linux config Wiki | Planet Sysadmin
The Sys Admin | {buhay sysad} | a non-geek's linux notes
Linux HOWTOs, Tutorials & Projects with Adam Palmer | LinuxAlt.Com
My name is Artem Nosulchik (artiomix AT gmail DOT com) and I'm Linux/Unix, Cisco systems engineer. The main idea of Linux Screw is to share relevant knowledge, skills and observations over The Web. Here you can find a lot of information related to different Linux distributions, FreeBSD, IOS as well as a other Open Source around staff. Read more ››