1

I have a program called /usr/bin/myprogram.x

In one shell window I did something like

cd /run001/
myprogram.x &
cd /run/009/
my program.x &
cd /run/234/
myprogram.x &

I kicked off a total of around 10 jobs, all under various directories, is there a way to find those run directories ?

If I do a ps -ef | grep myprogram.x it reports them all as /usr/bin/myprogram.x however I am looking for the directory each was kicked off under. Is there a way to find that?

ron
  • 6,575

1 Answers1

0

Just find their process ids (with ps) and in /proc/<PID>/ should be a link called cwd which points to the directory where process has stared.

jimmij
  • 47,140