How to tell if linux process is 64bit

Solution 1:

You can use file to get that information:

For example:

chris@obsidian:~$ file /usr/bin/perl
/usr/bin/perl: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), stripped

or read from /proc/

chris@obsidian:~$ file -L /proc/[PID]/exe
/proc/[PID]/exe: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), stripped

This will tell you if it is 64 or 32-bit.

Solution 2:

Starting from the PID you can:

file -L /proc/PID/exe