nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

Display number of processors on linux

This is a discussion on Display number of processors on linux within the Getting started tutorials forums, part of the Linux Getting Started category; Quick question - How do I display number of processors on linux? Simply use top command: Code: top Get info ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Getting started tutorials

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 02-23-2007, 01:10 PM
tom tom is offline
Contributors
User
 
Join Date: Jun 2005
Location: London, UK
Posts: 213
Rep Power: 4
tom is on a distinguished road
Default Display number of processors on linux

Quick question - How do I display number of processors on linux?

Simply use top command:
Code:
top
Get info from /proc/cpuinfo with the help of grep command
Code:
grep -c processor /proc/cpuinfo
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-06-2007, 09:15 PM
Senior Member
User
 
Join Date: Dec 2006
Location: /B!n@ry
My distro: openSuSE 10.2
Posts: 127
Rep Power: 0
B!n@ry
Send a message via MSN to B!n@ry
Default

tom,

the cmd top does not display the # of processors !!!
__________________
LivE Free 0r DiE
L!nux rul3z aLL
Reply With Quote
  #3 (permalink)  
Old 03-20-2007, 09:37 PM
raj raj is offline
Contributors
User
 
Join Date: Jun 2005
Location: Hyderabad
Posts: 151
Rep Power: 4
raj is on a distinguished road
Default

Quote:
Originally Posted by B!n@ry
tom,

the cmd top does not display the # of processors !!!
hey u can type top and hit 1 to see processors

cheers
__________________
Raj
Linux rulz.
I have never turned back in my life ; I shall not do so today.. haha
Reply With Quote
  #4 (permalink)  
Old 03-21-2007, 04:38 AM
Senior Member
User
 
Join Date: Dec 2006
Location: /B!n@ry
My distro: openSuSE 10.2
Posts: 127
Rep Power: 0
B!n@ry
Send a message via MSN to B!n@ry
Default

Quote:
Originally Posted by raj
Quote:
Originally Posted by B!n@ry
tom,

the cmd top does not display the # of processors !!!
hey u can type top and hit 1 to see processors

cheers
Oh, really nice ...
Thanx for that point raj
__________________
LivE Free 0r DiE
L!nux rul3z aLL
Reply With Quote
  #5 (permalink)  
Old 12-07-2007, 12:17 PM
Junior Member
User
 
Join Date: Dec 2007
My distro: Debian
Posts: 12
Rep Power: 0
virendra is on a distinguished road
Default

#top
this command will only show top running porcesses


#ps aux|wc -l
78

#ps -el|wc -l
78

#ps -ael|wc -l
78

show the number of running processes
Reply With Quote
  #6 (permalink)  
Old 03-24-2008, 05:22 PM
Member
User
 
Join Date: Mar 2008
My distro: Debian, Slackware, LFS
Posts: 83
Rep Power: 1
Tux-Idiot is on a distinguished road
Default

Quote:
Originally Posted by tom View Post
Quick question - How do I display number of processors on linux?

Simply use top command:
Code:
top
Get info from /proc/cpuinfo with the help of grep command
Code:
grep -c processor /proc/cpuinfo


correction

Code:
grep -c processor /proc/cpuinfo
[/quote]

right info for cpu

grep CPU /proc/cpuinfo
grep cpu /proc/cpuinfo

and to see the process in the linux machine? start searching in /proc/ thats the one which does the heavy dirty work! and also make sure you know difference between process and threads. like process is when you run xmms it opens up 3 windows, xmms is a process and those 3 windows are threads, threads are not identical with processess.
best way?
man lsof
Reply With Quote
  #7 (permalink)  
Old 08-12-2008, 01:55 AM
AQG AQG is offline
Junior Member
User
 
Join Date: Aug 2006
Posts: 6
Rep Power: 0
AQG
Default

How can I Get only the correct number of CPU's, the following output shows that my server has 8 CPU's but physically how many does it have? now I know it's not 8 of them???

grep CPU /proc/cpuinfo
model name : Intel(R) Xeon(R) CPU E5345 @ 2.33GHz
model name : Intel(R) Xeon(R) CPU E5345 @ 2.33GHz
model name : Intel(R) Xeon(R) CPU E5345 @ 2.33GHz
model name : Intel(R) Xeon(R) CPU E5345 @ 2.33GHz
model name : Intel(R) Xeon(R) CPU E5345 @ 2.33GHz
model name : Intel(R) Xeon(R) CPU E5345 @ 2.33GHz
model name : Intel(R) Xeon(R) CPU E5345 @ 2.33GHz
model name : Intel(R) Xeon(R) CPU E5345 @ 2.33GHz



grep cpu /proc/cpuinfo
cpu family : 6
cpu MHz : 2333.400
cpu cores : 4
cpuid level : 10
cpu family : 6
cpu MHz : 2333.400
cpu cores : 4
cpuid level : 10
cpu family : 6
cpu MHz : 2333.400
cpu cores : 4
cpuid level : 10
cpu family : 6
cpu MHz : 2333.400
cpu cores : 4
cpuid level : 10
cpu family : 6
cpu MHz : 2333.400
cpu cores : 4
cpuid level : 10
cpu family : 6
cpu MHz : 2333.400
cpu cores : 4
cpuid level : 10
cpu family : 6
cpu MHz : 2333.400
cpu cores : 4
cpuid level : 10
cpu family : 6
cpu MHz : 2333.400
cpu cores : 4
cpuid level : 10
Reply With Quote
  #8 (permalink)  
Old 08-12-2008, 11:51 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Ubuntu
Posts: 1,036
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Try
Code:
dmidecode --type 4 
dmidecode --type 4 | grep -c Socket
Get Information About Your BIOS / Server Hardware From a Shell Without Opening Chassis ( BIOS Decoder )
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Command to find which process is utilizing max number of resources in Red hat Linux Santosh Sharma Linux software 0 01-19-2008 04:12 PM
Script to display number of lines and words from a file newbewie Shell scripting 2 12-07-2007 11:37 PM
UNIX Display or list number of files in a current directory raj Getting started tutorials 1 12-07-2007 11:55 AM
Display Linux kernel information sweta Getting started tutorials 0 07-27-2007 08:00 AM
SuSe 10.0 doesn't recognize dual processors lacloai Linux software 6 07-22-2007 12:55 AM


All times are GMT +5.5. The time now is 09:10 PM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36