linux number of cpu 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\)'
Example 3: linux check cpu core
lscpu
#or
cat /proc/cpuinfo