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).
|