On Tue, 6 Oct 2020 11:47:22 +1300, I wrote:
Another useful command to use with ps is pgrep(1)
If you are expecting more than one process to match your criteria, it
is easy enough to use the “-d,” option to comma-separate them. Then the
output becomes acceptable to the “-p” option in ps, e.g.
ps -p$(pgrep -d, bash) -wwo pid,ppid,lstart,tty,etime,cmd
to report all the bash sessions I have running (quite a lot). The “ww”
says not to truncate the output, which is handy for long command lines.