LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-25-2011, 11:27 AM   #1
Captain Kirk
LQ Newbie
 
Registered: Jun 2008
Location: Aylesbury, England
Distribution: Mepis 8 and 8.5; Mythbuntu/Kubuntu; Xandros on eeePC
Posts: 1

Rep: Reputation: 0
How can I tell which version of a program is running?


For example, if different versions exist in /usr/bin/ and /usr/local/bin, how can I tell which one is actually being executed?
'which xxxxx' simply lists the first instance found in $PATH, which is usually /usr/local/bin/, but this may not necessarily be the actual instance that is running.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 01-25-2011, 11:32 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Quote:
Originally Posted by Captain Kirk View Post
'which xxxxx' simply lists the first instance found in $PATH, which is usually /usr/local/bin/, but this may not necessarily be the actual instance that is running.
Actually, yes! If the two binaries have the same name, the first encountered in PATH is that one executed. Unless you run it specifying its full path.
 
Old 01-25-2011, 02:02 PM   #3
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Rep: Reputation: 198Reputation: 198
As colucix says, but if you want to see what is actually currently running then use 'ps'. E.g

show all processes belonging to you
Code:
$ ps U $USER
See all processes
Code:
$ ps ax
 
2 members found this post helpful.
Old 01-25-2011, 04:12 PM   #4
ptader
LQ Newbie
 
Registered: Jan 2011
Location: Chicago, Il. USA
Distribution: Ubuntu
Posts: 4

Rep: Reputation: 0
Check out the exe link in /proc/<PID>/

$ ps -ef|grep terminal
ptader 14892 14891 0 13:20 ? 00:00:12 gnome-terminal

$ sudo ls -l /proc/14892/exe
lrwxrwxrwx 1 ptader ptader 0 2011-01-25 16:10 /proc/14892/exe -> /usr/bin/gnome-terminal
 
  


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
unrecognized class file version : when running simple Java program yuubouna Linux - Newbie 1 11-27-2008 11:25 PM
Running program from terminal with & does nothing, program stops DittoAlex Linux - General 1 10-05-2007 01:35 AM
rpmdb: Program version 4.2 doesn't match environment version jhibbets Red Hat 2 05-29-2007 09:57 PM
Problem of Linux kernel version mismatch while running the compile program Nishant Desai Linux - Kernel 8 03-12-2007 08:22 AM
wlan0 has been compiled with version 18, this program supports up to version 17. dave`2005 Linux - Wireless Networking 1 11-23-2005 04:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:34 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