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?
pgrep
, which may be safer. – Kusalananda Feb 25 '19 at 23:41