If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!
Here’s how to display the number of processor of your linux box.
Simply issue the following command as root
# cat /proc/cpuinfo | grep processor
Everything in linux is files. This command simply retrieves the number of processors that linux detected from /proc/cpuinfo and displays it. Usually, the processor number comes at the first set of line from issuing the command.
Here’s what the command returned for me:
~~~~~~~~~~~~~~~~~~~~~~~~
processor : 0
~~~~~~~~~~~~~~~~~~~~~~~~
which means You have 1 processor with a processor ID number 0. Processor counting starts with 0.
So if you have a PC with core duo, you will probably have 2 lines that says 0 and 1.That is 2 processors.
You may also be interested in...
August 24th, 2007 at 2:10 pm
Ever heard of hyperthreading? If it’s on in the BIOS, it’ll incorrectly double the number…
September 2nd, 2007 at 11:48 am
Lev: I once ate that with some proliant server, it had only one CPU, and because of HyperThreading, I thought there are 2…
September 3rd, 2007 at 2:45 am
There is a lot simpler solution. Just type ‘top’ at the command prompt and then press ‘1′ (number one).
You will see the ACTUAL CPUs listed on the top of the page
September 3rd, 2007 at 8:50 am
> Simply issue the following command as root
*Not* as root, because:
# ls -l /proc/cpuinfo
-r–r–r– 1 root root 0 2007-09-03 15:49 /proc/cpuinfo
(Unless your system uses other permissions than mine, but I don’t see why it should do that.)
Misuse of cat:
> # cat /proc/cpuinfo | grep processor
Simply use:
# grep processor /proc/cpuinfo
September 3rd, 2007 at 8:52 am
Your script is broken:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/debianad/public_html/wp-content/plugins/SK2/sk2_second_chance.php:2) in /home/debianad/public_html/wp-content/plugins/pxsmail.php on line 1
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/debianad/public_html/wp-content/plugins/SK2/sk2_second_chance.php:2) in /home/debianad/public_html/wp-content/plugins/pxsmail.php on line 1
Thank you. Your comment has been approved.
September 19th, 2007 at 9:28 pm
If your kernel does not have SMP support compiled in, `cat /proc/cpuinfo` will only show one processor, even if you have more than one cpu.