The command below displays the number of processors on the Ubuntu Server. It looks in the /proc/cpuinfo file, and pulls out the number of lines containing the word “processor” and passes them into wc (word count), which returns a count of the CPUs in the system.
cat /proc/cpuinfo | grep processor | wc -l