On unix, how could we know whether the system is multiprocessor or uniprocessor?
A:
I don't know if it applies to Unix as well, but for Linux, from command line, see here: http://www.howtogeek.com/howto/ubuntu/display-number-of-processors-on-linux/
Konamiman
2009-11-09 08:00:38
procfs is pretty much only a Linux thing. You won't see it on many other systems. FreeBSD for example only has it if the Linux compat stuff is installed.
Joey
2009-11-09 08:13:33
i cant find any cpuinfo file in /proc/.so does it mean that there is no way we cant find the answer on unix?
Vijay Sarathi
2009-11-09 09:28:50
+1
A:
How about
cat /proc/cpuinfo | grep -i 'processor' | wc -l
Or even
dmesg | grep -i cpu
Look out for "Brought up x processors" in the last one
Andrei Serdeliuc
2009-11-09 08:02:03
procfs is pretty much only a Linux thing. You won't see it on many other systems. FreeBSD for example only has it if the Linux compat stuff is installed.
Joey
2009-11-09 08:06:11
Yes johannes. u seem to be right. i cant find any cpuinfo file in /proc/.so does it mean that there is no way we cant find the answer on unix?
Vijay Sarathi
2009-11-09 09:28:02
-1 since i have tagged for only unix and linux answer doesnt help me
Vijay Sarathi
2009-11-09 10:04:29
+2
A:
Some times we have to answer owr own question :)
On Solaris run the command
/usr/sbin/psrinfo -v|grep "Status of processor"|wc -l
On AIX run the command
lsdev -C|grep Process|wc -l
On HP-UX run the following commands (requires superuser privileges):
P=`echo processor_count/D | adb -k /stand/vmunix /dev/mem |tail -1|awk '{print $2}'` echo "The number of processors on `hostname` = $P"
On Tru64 run the command
/usr/sbin/psrinfo -v|grep "Status of processor"|wc -l
Vijay Sarathi
2009-11-09 10:01:46