How to determine whether the processor supports 64-bit instruction set

If you ever wondered how to determine whether the processor is 64-bit capable then I have simple and straight answer for you.

Check CPU flags

The most portable way is to read /proc/cpuinfo file and search for lm flag.

$ sed -n -e '0,/^flags/{/^flags/{/ lm /{s/.*/64bit!/;p}}}' /proc/cpuinfo
64bit!

It looks overcomplicated so let's simplify it a bit.

$ grep -m1 ^flags /proc/cpuinfo | sed "/ lm / {s/.*/64bit\!/}"
64bit!

The above mentioned commands will search the first flags occurrence for the lm flag, and print 64-bit! on match.

Check CPU op-mode(s)

This solution is simpler but not as portable as the previous one.

$ lscpu | grep op-mode
CPU op-mode(s):        32-bit, 64-bit

Check CPU model name

You can always verify specification for given model name although it is not very convenient without internet access.

$ cat /proc/cpuinfo | grep  -m 1 "model name"
model name	: Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz
Milosz Galazka's Picture

About Milosz Galazka

Milosz is a Linux Foundation Certified Engineer working for a successful Polish company as a system administrator and a long time supporter of Free Software Foundation and Debian operating system. He is also open for new opportunities and challenges.

Gdansk, Poland https://sleeplessbeastie.eu