PID is the process ID you are interested in Returns 0 if the process is 32 bit, or 4 if it is 64bit (using the LP64 flag associated with the process -bit 4 in the integer returned by ps -o flags). bin/bash: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped MacOS X To examine the architecture of a running processĮcho $((4 & ps -o flags -p PID |tail -1)) proc/1116/exe: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.4.0, not stripped To examine the architecture of an executable binary. (where PID is the process ID you are interested in) LINUX To get the architecture of a running process.