How to check if Ubuntu has booted in UEFI or BIOS?

Ubuntu Logo

How to check if Ubuntu has booted in UEFI or BIOS?

[ -d /sys/firmware/efi ] && echo "Installed in UEFI mode" || echo "Installed in Legacy BIOS mode"