linux check number of cpus code example
Example 1: ubuntu check how many cores
cat /proc/cpuinfo | grep processor | wc -l
Example 2: chcek number of cpus available on linux machine
lscpu | egrep 'CPU\(s\)'
cat /proc/cpuinfo | grep processor | wc -l
lscpu | egrep 'CPU\(s\)'