Command-line Number of thread per process on MacOS
Try the following:
NUM=`ps M <pid> | wc -l` && echo $((NUM-1))
We subtract 1 from the line count because ps
outputs a HEADER in the 1st line.
This also works:
ps M <pid> | wc -l
Try the following:
NUM=`ps M <pid> | wc -l` && echo $((NUM-1))
We subtract 1 from the line count because ps
outputs a HEADER in the 1st line.
This also works:
ps M <pid> | wc -l