In this video, we will explore various methods to determine the number of CPUs on a Linux system at the shell prompt. These techniques can be used in shell scripts or shell command-line to parallelize tasks based on the number of available CPUs in your Linux system.
...
https://www.youtube.com/watch?v=A7Mra3sk2ec