Linux Find Out BIOS Version Using a Command Line Option

See all GNU/Linux related FAQ
Do you need to find the BIOS/UEFI version using a Linux command line option? Here is how to check the motherboard BIOS or UEFI version using Linux command line options without rebooting your Linux system.

To find out BIOS version under Linux operating systems use the dmidecode command which is a tool to analyze BIOS data. You must log in as root user to run dmidecode command.
Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements Linux terminal
Category System Management
OS compatibility AlmaLinux Alpine Arch BSD CentOS Debian Fedora Linux Mint openSUSE Pop!_OS RHEL Rocky Slackware Stream SUSE Ubuntu
Est. reading time 3 minutes

Linux find out BIOS version command

Type the following dmidecode command as the root user:
# dmidecode | less
## or use sudo ##
$ sudo dmidecode | less

Sample outputs:

dmidecode 2.10
SMBIOS 2.5 present.
45 structures occupying 1832 bytes.
Table at 0xCFF6A000.

Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
        Vendor: Phoenix Technologies LTD
        Version: 2.1
        Release Date: 06/23/2008
        Address: 0xE4F00
        Runtime Size: 110848 bytes
        ROM Size: 1024 kB
        Characteristics:
                PCI is supported
                PNP is supported
                BIOS is upgradeable
                BIOS shadowing is allowed
                ESCD support is available
                Boot from CD is supported
                Selectable boot is supported
                EDD is supported
                3.5"/2.88 MB floppy services are supported (int 13h)
                ACPI is supported
                USB legacy is supported
                LS-120 boot is supported
                ATAPI Zip drive boot is supported
                BIOS boot specification is supported
                Targeted content distribution is supported

Finding Linux laptop BIOS version using a command Line option

Here is another output from my laptop:
$ sudo dmidecode | less
Sample outputs:

BIOS Information
        Vendor: Dell Inc.
        Version: A02
        Release Date: 02/03/2010
        Address: 0xF0000
        Runtime Size: 64 kB
        ROM Size: 2112 kB
        Characteristics:
                ISA is supported
                PCI is supported
                PC Card (PCMCIA) is supported
                PNP is supported
                BIOS is upgradeable
                BIOS shadowing is allowed
                Boot from CD is supported
                Selectable boot is supported
                3.5"/720 KB floppy services are supported (int 13h)
                Print screen service is supported (int 5h)
                8042 keyboard services are supported (int 9h)
                Serial services are supported (int 14h)
                Printer services are supported (int 17h)
                CGA/mono video services are supported (int 10h)
                ACPI is supported
                USB legacy is supported
                AGP is supported
                Smart battery is supported
                BIOS boot specification is supported
                Function key-initiated network boot is supported
                Targeted content distribution is supported
        BIOS Revision: 0.2
        Firmware Revision: 0.2

Handle 0x0100, DMI type 1, 27 bytes
System Information
        Manufacturer: Dell Inc.
        Product Name: Precision M6500                 
        Version: Not Specified
        Serial Number: 55Lxxxx
        UUID: 4a2yzzzeC-3500-xxx-yyy-Bzzzzyyy5y
        Wake-up Type: Power Switch
        SKU Number: Not Specified
        Family:  

How to check BIOS firmware version in Linux

In this example display BIOS version using the -s option. For example:
$ sudo dmidecode -s bios-version
Let us try a bash for loop example to get more info:

for d in system-manufacturer system-product-name bios-release-date bios-version
do
   echo "${d^} : " $(sudo dmidecode -s $d)
done
Linux Find Out BIOS Version using dmidecode command

Use the dmidecode command on Linux to find out BIOS version, release date and more

It is possible to print all bios related info using the following syntax too:
$ sudo dmidecode --type bios
Sample outputs:

# dmidecode 3.1
Getting SMBIOS data from sysfs.
SMBIOS 3.0.0 present.
 
Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
	Vendor: American Megatrends Inc.
	Version: GL702ZC.305
	Release Date: 05/10/2018
	Address: 0xF0000
	Runtime Size: 64 kB
	ROM Size: 16 MB
	Characteristics:
		PCI is supported
		BIOS is upgradeable
		BIOS shadowing is allowed
		Boot from CD is supported
		Selectable boot is supported
		BIOS ROM is socketed
		EDD is supported
		5.25"/1.2 MB floppy services are supported (int 13h)
		3.5"/720 kB floppy services are supported (int 13h)
		3.5"/2.88 MB floppy services are supported (int 13h)
		Print screen service is supported (int 5h)
		Serial services are supported (int 14h)
		Printer services are supported (int 17h)
		ACPI is supported
		USB legacy is supported
		Smart battery is supported
		BIOS boot specification is supported
		Targeted content distribution is supported
		UEFI is supported
	BIOS Revision: 5.12

Finding Thinkpad X1 or Dell laptop BIOS firmware version

Again, simply run:

for d in system-manufacturer system-product-name bios-release-date bios-version
do
   echo "${d^} : " $(sudo dmidecode -s $d)
done

Here is what I see:

[sudo] password for vivek: 
System-manufacturer :  LENOVO
System-product-name :  20QVCTO1WW
Bios-release-date :  11/13/2023
Bios-version :  N2OET62W (1.49 )

How does it works?

The Linux command-line Kung fu aims to print out the system manufacturer, system product name, BIOS release date, and BIOS version.

  • The command uses the for loop to iterate over the list of variables, named: system-manufacturer, system-product-name, bios-release-date, and bios-version. In other words, we creates a loop that iterates over the list of variables.
  • For each variable, the command uses the echo command to print out the variable value using the dmidecode command. The -s option is passed to the dmidecode command to state the DMI table entry to decode. In this bash for loop, the -s option is used to decode the entries for the system manufacturer, system product name, BIOS release date, and BIOS version.
  • The sudo command must be used to run the dmidecode command with root or sysadmin level privileges on Linux box.
  • Please note that the echo "${d^} line turn first letter of the variable to UPPERCASE. It makes reading easier. See how to use bash parameter substitution like a pro to learn about those bash modification.

How to update BIOS version on Thinkpad using Linux

You can grab the cab file for your model from Lenovo.com and then run it as follows:
$ sudo fwupdmgr install N2OET52W.cab
Here is what I see:

Decompressing…           [***************************************]
Authenticating…          [ -                                     ]
Authenticating…          [***************************************]
Installing on System Firmware…                                   ]
Scheduling…              [***************************************]
Successfully installed firmware
 
An update requires a reboot to complete. Restart now? [y|N]: y

Getting BIOS and other information using the /sys/class/dmi/id/

Try the cat command or bat command as follows:
$ cat /sys/class/dmi/id/bios_version
$ ls -l /sys/class/dmi/id/

Here is the list of file under Linux to find out BIOS version and other info:

total 0
-r--r--r-- 1 root root 4096 Jun 17 14:59 bios_date
-r--r--r-- 1 root root 4096 Jun 17 15:07 bios_release
-r--r--r-- 1 root root 4096 Jun 10 17:56 bios_vendor
-r--r--r-- 1 root root 4096 Jun 17 14:59 bios_version
-r--r--r-- 1 root root 4096 Jun 17 15:07 board_asset_tag
-r--r--r-- 1 root root 4096 Jun 10 17:56 board_name
-r-------- 1 root root 4096 Jun 17 15:07 board_serial
-r--r--r-- 1 root root 4096 Jun 10 17:56 board_vendor
-r--r--r-- 1 root root 4096 Jun 17 15:07 board_version
-r--r--r-- 1 root root 4096 Jun 17 15:07 chassis_asset_tag
-r-------- 1 root root 4096 Jun 17 15:07 chassis_serial
-r--r--r-- 1 root root 4096 Jun 10 17:56 chassis_type
-r--r--r-- 1 root root 4096 Jun 17 15:07 chassis_vendor
-r--r--r-- 1 root root 4096 Jun 17 15:07 chassis_version
-r--r--r-- 1 root root 4096 Jun 17 15:07 ec_firmware_release
-r--r--r-- 1 root root 4096 Jun 10 17:56 modalias
drwxr-xr-x 2 root root    0 Jun 12 09:40 power
-r--r--r-- 1 root root 4096 Jun 17 15:07 product_family
-r--r--r-- 1 root root 4096 Jun 10 17:56 product_name
-r-------- 1 root root 4096 Jun 17 15:07 product_serial
-r--r--r-- 1 root root 4096 Jun 17 15:07 product_sku
-r-------- 1 root root 4096 Jun 10 17:56 product_uuid
-r--r--r-- 1 root root 4096 Jun 10 17:56 product_version
lrwxrwxrwx 1 root root    0 Jun 10 17:56 subsystem -> ../../../../class/dmi
-r--r--r-- 1 root root 4096 Jun 10 17:56 sys_vendor
-rw-r--r-- 1 root root 4096 Jun 10 17:56 uevent

Next, try the bash for loop as follows to show required BIOS information:

for i in board_vendor board_version bios_vendor bios_version
do 
  echo "${i^} : " $(</sys/class/dmi/id/$i)
done

Sample outputs:

Board_vendor :  LENOVO
Board_version :  SDK0R32862 WIN
Bios_vendor :  LENOVO
Bios_version :  N2OET59W (1.46 )

Conclusion

The dmidecode command summarizes information about your system’s hardware (laptop/desktop/server) as described in your system BIOS. It works with i386, x86-64, ia64 and arm64. For more info see the official project homepage here. Read the following manual pages using the help command or man command for more information at the CLI:
$ man dmidecode
$ help for
$ dmidecode --help

Usage: dmidecode [OPTIONS]
Options are:
 -d, --dev-mem FILE     Read memory from device FILE (default: /dev/mem)
 -h, --help             Display this help text and exit
 -q, --quiet            Less verbose output
 -s, --string KEYWORD   Only display the value of the given DMI string
 -t, --type TYPE        Only display the entries of given type
 -H, --handle HANDLE    Only display the entry of given handle
 -u, --dump             Do not decode the entries
     --dump-bin FILE    Dump the DMI data to a binary file
     --from-dump FILE   Read the DMI data from a binary file
     --no-sysfs         Do not attempt to read DMI data from sysfs files
     --oem-string N     Only display the value of the given OEM string
 -V, --version          Display the version and exit

🥺 Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🤠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

10 comments… add one
  • Pranav Inamdar Jan 7, 2011 @ 13:14

    Worked for me thanks..!!! :)

  • alok Jun 19, 2011 @ 10:35

    Alternate way,
    /usr/sbin/dmidecode -s bios-vendor && /usr/sbin/dmidecode -s bios-version

    Same way you can fetch lot more type details..

  • dasmoscas Dec 10, 2013 @ 19:44

    great, thanks!

  • raiched Oct 8, 2015 @ 15:19

    dmidecode --type 148 | more
    OEM-specific Type

  • praskash Nov 3, 2015 @ 14:49

    How can we update bios manually in Linux Ubuntu.

  • Hossein Jan 3, 2017 @ 16:51

    Thanks :)

  • syeda Sep 30, 2020 @ 5:02

    Hi,

    can anybody list the books good for learning SERVER HARDWARE commadnds using linux

  • Helium_40026 Jan 4, 2023 @ 12:12

    Weltklasse Hinweis! Danke!
    Excellent Info! THX, very much!

  • John Jun 17, 2023 @ 5:28

    Thank you very much, this helped a lot !!

  • Mark E. Williamson Jun 26, 2023 @ 14:29

    Thank you so much for this information. In this difficult time of widespread government sponsored hacking, your efforts are greatly appreciated. This may save my life. Kudos!!

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.