LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-16-2010, 07:01 PM   #1
brgsousa
Member
 
Registered: Aug 2007
Location: Salvador, Brazil
Distribution: Debian, Ubuntu
Posts: 185

Rep: Reputation: 15
find out if it is32 or 64 bit process


Hi everyone,
Using Debian Squeeze amd64.
How can I find out, from running process, which ones are 32 bit, and which ones are 64 bits?
 
Old 05-16-2010, 08:37 PM   #2
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
I'm not sure what exceptional cases might exist where this doesn't work. I also don't know if I'm ignoring some easier or more reliable method (I know several harder methods). But what I have is:

Code:
file -L /proc/pid/exe
replacing pid with the pid of the process that you want the info on.

Last edited by johnsfine; 05-16-2010 at 08:46 PM.
 
Old 05-16-2010, 11:50 PM   #3
brgsousa
Member
 
Registered: Aug 2007
Location: Salvador, Brazil
Distribution: Debian, Ubuntu
Posts: 185

Original Poster
Rep: Reputation: 15
Thanks! It worked fine on Debian.
It should be easier, like a column in 'top' :P
 
Old 08-11-2010, 03:20 AM   #4
xakup
LQ Newbie
 
Registered: Aug 2010
Location: Russia, Saint-Petersburg
Posts: 1

Rep: Reputation: 0
Hi all! Is there any other way to get it programmatically, like a special flag somewhere in /proc/<pid>/, etc.??

edit:
OK, I have ended up parsing process executable (/proc/<pid>/exe or /proc/<pid>/cmdline)
the 5th byte in ELF header can be 1 if compiled as 32 bit or 2 for 64

Last edited by xakup; 08-13-2010 at 06:49 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wine 32 bit on Slackware 13 64 bit problems: configure can't find some libraries ozanbaba Slackware 28 11-26-2010 02:42 PM
How do I find whether any linux kernel supports 32-bit or 64-bit architecture? dev_d Linux - Newbie 3 02-24-2010 02:52 PM
How to find if an OS is 32 bit or 64 bit using a program ? lali.p Programming 12 05-24-2009 12:51 AM
How to find the process ID of process executing in the background akeneche Linux - Newbie 1 01-03-2008 10:08 AM
How do i find out if the machine is 64-bit or 32-bit? hondo Linux - General 2 07-12-2007 05:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration