Get the number of threads for a running process in Linux

  1. Get process PID:
    ps uax|grep {{ process_name }}
  2. Get number of threads:
    cat /proc/{{ process_PID }}/status | grep Threads
Example for htop process:
$ cat /proc/$(ps aux | grep -E "htop\$" | grep -v grep | awk '{print $2}')/status | grep Threads
Threads:	1