
25 Oct
2020
25 Oct
'20
12:13 p.m.
On Tue, 6 Oct 2020 11:47:22 +1300, I wrote:
Another useful command to use with ps is pgrep(1) <https://man7.org/linux/man-pages/man1/pgrep.1.html>
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.