3 ms·
I often roll with 'pgrep' part of pkill package to fetch the pids of either the ucomm or longname (-l) of the process. pgrep -l 'reg.*ex" | xargs -L1 do-stuff
by vidoc 9y ago
I often roll with 'pgrep' part of pkill package to fetch the pids of either the ucomm or longname (-l) of the process.
pgrep -l 'reg.*ex" | xargs -L1 do-stuff
or just pkill if the idea is just to send a signal.
To gather particular process metrics, ps can be invoked with process ids (-p), with full control of its output (-o), grep is rarely needed.