I am a new Linux system user. How do I determine if my CPU is 64bit or not on a Linux operating systems using command line option? How can I check Linux kernel is in 32 bit or 64 bit mode?
You need to use the following commands to find out information about Linux kernel and CPU architecture:
- [donotprint][/donotprint]
- getconf LONG_BIT command: This command check if the OS (kernel) is 32 bit or 64 bit.
- uname command: This command prints system information including kernel version and whether kernel (os) is 32 bit or 64 bit.
- /proc/cpuinfo file: Use this file to determine if CPU is 64 bit or 32 bit i.e. find out CPU architecture.
Example – Find out if running Linux kernel (OS) is 32 or 64 bit
Type the following command at the terminal:
$ uname -a
Sample output:
Linux ora100 2.6.5-7.252-smp #1 SMP Tue Feb 14 11:11:04 UTC 2006 x86_64 x86_64 x86_64 GNU/Linux
x86_64 GNU/Linux indicates that you’ve a 64bit Linux kernel running. If you use see i386/i486/i586/i686 it is a 32 bit kernel. You can also use the following command to find out if Linux kernel is running in 32bit or 64bit mode:
$ getconf LONG_BIT
Sample outputs:
64
NOTE: If you are running 32 bit cpu, you will see 32 bit as output.
How do I find out CPU is 32bit or 64bit on a Linux system?
Simply type the following grep command and if you see lm in output, you have a 64 bit CPU based system:
$ grep flags /proc/cpuinfo
OR
$ grep -o -w 'lm' /proc/cpuinfo | sort -u
Output:
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm
More about CPU modes:
- lm flag means Long mode cpu – 64 bit CPU
- Real mode 16 bit CPU
- Protected Mode is 32-bit CPU
Demo
See also:
- How To Find Out FreeBSD Version and Patch Level Number
- How To Find Which Linux Kernel Version Is Installed On My System
- Find Linux / UNIX Kernel Version Command
- How To Find Out If 32 or 64 bit Unix OS Installed On Server
- Linux: Find If Processor (CPU) is 64 bit / 32 bit [long mode ~ lm]
- List or Check Installed Linux Kernels
- Find Linux Kernel Version Command
- Linux Command: Show Linux Version