If you ever wondered how to determine whether the processor is 64-bit capable, then I have a 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 specifications for a given model name, although it is not convenient without internet access.

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