I have a RHEL machine that I run many processes on. A lot of the processes may have equivalent start parameters, so from top
and ps
they are identical in this category and cannot be identified from one another.
How could I name or tag a process in its parameters so I can identify one from another? Aside from doing this in bash, how would I do this for a Java process or screen session?
The canonical way to do this would be to obtain the process id with $!
. That way you don't tag the process, but you have an id that uniquely identifies it. For example:
gedit & gedit1=$!
This starts gedit and saves the process id in the variable gedit1
. If I want to kill the process later. I can just write
kill $gedit1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With