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

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

$ grep -m1 ^flags /proc/cpuinfo | sed "/ lm / {s/.*/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 system administrator working for a successful Polish company and a long time supporter of Free Software Foundation and Debian operating system.

Gdansk, Poland