I need help writing a command to be placed in .sh. I want to return the process ID that is below 3678 in the output, but I have diffuclty because the process ID changes every time it restarts, so my code is interrupted
Conclusion:
[root@server1 /usr/home/aaron]
www 3678 0.0 3.2 1308176 267864 ?? Is 3:21PM 0:17.19 [java]
[root@server1 /usr/home/aaron]
Here is what I did until I realized that the column changed when the pid changed:
ps -xauww | grep java | grep www | cut -d" " -f6
Any help is appreciated. thank.
source
share