Skip to content

Instantly share code, notes, and snippets.

@o0-o
Last active May 7, 2019 02:30
Show Gist options
  • Save o0-o/5a080bcbe5457bc09e3b58f4026c1d1d to your computer and use it in GitHub Desktop.
Save o0-o/5a080bcbe5457bc09e3b58f4026c1d1d to your computer and use it in GitHub Desktop.
[Number Threads] Prints the number of processing threads #Shell
# cpu_threads.sh
( # linux
getconf _NPROCESSORS_ONLN ||
# bsd
sysctl -n hw.ncpu
) 2>/dev/null ||
exit 1 #failture
exit 0 #success
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment