How to identify 64 bit processor with cat /proc/cpuinfo
Solution 1:
Use the lscpu command.
32bit example output:
$ lscpu
Architecture: i686
CPU op-mode(s): 32-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 4
Core(s) per socket: 1
Socket(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 26
Stepping: 5
CPU MHz: 2260.998
BogoMIPS: 4521.99
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 8192K
64bit example:
$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
CPU(s): 4
Thread(s) per core: 1
Core(s) per socket: 4
CPU socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 23
Stepping: 6
CPU MHz: 2327.533
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 6144K
Solution 2:
The flags
section will contain lm
if you have a Intel 64-/AMD 64-capable CPU. Other 64-bit architectures should have similar flags that you can look for.
Solution 3:
To know if the installed Ubuntu is of 32 or 64 bits:
a) getconf LONG_BIT
b) uname -m
If it shows i686 or i386 it means 32 bits. If it shows x86_64 it means 64 bits.
If the CPU is of 32 bits Ubuntu must be of 32 bits. If the CPU is of 64 bits it can work in 64 or 32 bits. So we can choose: Ubuntu can be of 32 bits or of 64 bits.
To know if the CPU is of 32 or 64 bits:
a) grep -w lm /proc/cpuinfo
If we see lm in red is of 64 bits. Otherwise is of 32 bits.
b) sudo lshw | grep "description: CPU" -A 12 | grep width
It says clearly what we want to know.