LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-31-2005, 09:54 AM   #1
kaplan71
Member
 
Registered: Nov 2003
Posts: 809

Rep: Reputation: 39
pathname in ps command


Is there an option in the ps command that would list the full pathname to the binary, script, etc. of a process that is running?
 
Old 10-31-2005, 12:57 PM   #2
Hobbletoe
Member
 
Registered: Sep 2004
Location: Dayton, Oh
Distribution: Linux Mint 17
Posts: 150

Rep: Reputation: 18
No. The reason for that is that it will only show the command that was used to start the process. So, if I were to be in a directory and run a command with

$ . ./some_command &

ps will only show that (. ./some_command). If I were to run the command with

$ . /usr/some_directory/some_command

Then ps would show the entire path as it was used to start the command.

I suppose that you could cobble something together to pull the command out of ps, then run it through locate to find where that script resides, but that is assuming that you are not looking for a generic command (i.e. test on a server where you have a bunch of programmers might give you a bit of a problem).
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Determine absolute pathname aecaudel Programming 5 09-19-2005 01:06 AM
Replacing All Instances of a pathname with another in Vi Editor kaplan71 Linux - General 1 06-30-2005 03:54 PM
setting pathname for input file in C++ microsoft/linux Programming 27 05-09-2005 09:36 PM
openOffice template directory - what is the pathname? TSynergy Linux - Software 4 10-11-2004 09:53 PM
Scripting help -- pathname expansion player_2 Programming 3 08-25-2003 05:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:35 AM.

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