1
First:
sudo netstat -nptc | grep -oP "\K[0-9]*(?=/perl)"
The above gives me the pid as they are started, so it is constantly running.
Second:
For each output of the first command above I want to execute below:
ps aux | grep <output of first>
How can this be done?
I tried your solution but didn't work, it doesn't return anything, this part works sudo netstat -nptc | grep -oP "\K[0-9]*(?=/perl)" but the next part returns nothing. – Exocomp – 2017-07-25T17:36:08.590