This topic was published by DevynCJohnson and viewed 1192 times since "". The last page revision was "".
- Topics - 444
In Linux, it may be important at times to know the architecture of the system. In a terminal, there are many ways to figure this out. Some of these methods may only work on particular Linux distros while some work on all (or nearly all) Linux systems.
Most Linux system have the "uname" command. Type
uname -pmto view the architecture.
On Linux systems that use "init", type
file /sbin/init. The output may look something like below.
/sbin/init: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=7a4c688d009fc1f06ffc692f5f42ab09e68582b2, stripped
Another method includes using the "getconf LONG_BIT" command.
Some systems support the "arch" command which is equivalent to running "uname -m".
On Debian-based systems, users can use the
On systems that use BASH, the code below will test the architecture type via a buffer overflow.
if ((1<<32)); then echo "64-bit" else echo "32-bit" fi
On many Unixoid systems using proc, executing
cat /proc/cpuinfodisplays various information about the CPU.
If one or more of these methods fail, then try the other listed methods until a command executes successfully and provides the needed information.
- x86 vs i386 vs Other Processor Terms - http://dcjtech.info/topic/x86-vs-i386-vs-other-processor-terms/
- Hardware Probing Using Linux - http://dcjtech.info/topic/hardware-probing-using-linux/