Friday, January 16, 2015

Get number of threads in a *nix process

Just so I don't forget this:

ps -L -o pid= -p  | wc -l

on OSX(also works on linux I believe)

NUM=`ps M  | wc -l | xargs` && expr $NUM - 1