How to find number of CPUs on unix system

Newer processors are multi-core and could have hyper-threading enabled. So there are time when user may need to know how many cores (virtual) processors are available and how many Physical (real) processors are installed. CPU information can be retrieved via /usr/sbin/psrinfo on SunOS while it is available in /proc/cpuinfo on Linux. /proc/cpuinfo on Linux contains information about each available core. Following command combinations can be used to retrieve the number of CPUs.

OS Physical Processors Cores available
SunOS /usr/sbin/psrinfo -p /usr/sbin/psrinfo | wc -l
Linux grep “^physical id” /proc/cpuinfo | awk ‘{print $NF}’ | sort -u | wc -l grep processor /proc/cpuinfo | wc -l
IRIX hinv | grep -i processor | head -n1 | cut -d’ ‘ -f1

Update: Thanks Matias for tip on IRIX.

Hardware : Dell GX620 SFF HTPC Bootup problem due to burned up capactiors

I added a PCI Express Video card to my Dell GX620 Small Form Factor desktop system and connected it to my Television. One small thing that I completely missed out was the amount of heat that gets generated in such a small confined spot with no outlet for that hot air. And one day it refused to boot up. It will not go to POST. The power LED will come Green, fan on the processor will come on and then switch off. After 3-4 retries it will boot up and display “A Thermal Event has occurred“. But I did not pay attention to that. Silly me. After couple of days it started to take about 20 tries. That’s when I started to search around.

There were so many posts but no real answers. But there was a common lead badmouthing Dell and other PC manufacturers that for saving cost they have used cheap capacitors that burn up.  In my case that was certainly not true. The system had best that market has to offer (Rubycon capacitors) but it was me who managed to burn them off. I got the final on it when I stumbled upon A very good website with information on what exactly was going on. So I opened up the system, took out the hard-disk and right under it on the mother board were four capacitors (2200 µF, 6.3V, 10mm) that were popped. The heat from Video card fried the poor chaps as they were too close.

Continue reading