Good day all,
I am trying to write a bash script to show all processes of java, however i would like it to display in the below manner.
ps -p $PID -o pid,vsz=MEMORY -o user,group=GROUP -o comm,args=ARGS
The problem with the above is that it only show one particular PID.
So I want to
ps aux|grep j\[a\]va get the PID of each and then run each PID in the above command.
root@reinhardt-VirtualBox:/home/reinhardt# ps -p 1959 -o pid,vsz=MEMORY -o user,group=GROUP -o comm,args=ARGS PID MEMORY USER GROUP COMMAND ARGS 1959 13648 root root grep grep --color=auto java
I would guess some sort of loop will be made like for loop?