nixCraft Linux Forum

nixCraft

Linux / UNIX 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

Linux answers from nixCraft.


Getting started tutorials So much to read, so little time! If that is your problem, we have solution. Read our FAQ and tutorials to help you cut through the clutter of information overload. Only members of "contributors" group can post new tutorials. Other members can just reply to thread.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 23-02-2007, 12:10 PM
tom tom is offline
Contributors
User
 
Join Date: Jun 2005
Location: London, UK
Posts: 213
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 5
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
  #2 (permalink)  
Old 06-03-2007, 08:15 PM
B!n@ry's Avatar
Senior Member
User
 
Join Date: Dec 2006
Location: B!n@ry-z0ne
OS: Ojuba 3
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts
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 20-03-2007, 08:37 PM
raj's Avatar
raj raj is offline
Senior Member
User
 
Join Date: Jun 2005
Location: Hyderabad
OS: Fedora, Debian Linux
Posts: 307
Thanks: 42
Thanked 8 Times in 8 Posts
Rep Power: 6
raj will become famous soon enough raj will become famous soon enough
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 21-03-2007, 03:38 AM
B!n@ry's Avatar
Senior Member
User
 
Join Date: Dec 2006
Location: B!n@ry-z0ne
OS: Ojuba 3
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts
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 07-12-2007, 11:17 AM
Junior Member
User
 
Join Date: Dec 2007
OS: Debian
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
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 24-03-2008, 04:22 PM
Member
User
 
Join Date: Mar 2008
OS: Debian, Slackware, LFS
Posts: 82
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 2
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 12-08-2008, 12:55 AM
AQG AQG is offline
Junior Member
User
 
Join Date: Aug 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
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 12-08-2008, 10:51 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 245 Times in 184 Posts
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 Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #9 (permalink)  
Old 20-12-2008, 01:43 PM
Junior Member
User
 
Join Date: Dec 2008
OS: Debian
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
pritam.linux is on a distinguished road
Red face

top and grep -c processor /proc/cpuinfotop
commands are not same sir..
ple describe me...
i m getting from it that
the top comm and is showing the total process info. (tasks ). which are currently on
but grep -c ......XXXXXXXX...........command showing how many no of process going on.. how they are same.. plz ans me

Last edited by pritam.linux; 20-12-2008 at 01:48 PM.
Reply With Quote
  #10 (permalink)  
Old 22-12-2008, 07:56 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 245 Times in 184 Posts
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

You need to only type:
Code:
grep -c processor /proc/cpuinfo
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
Reply


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 Off


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 19-01-2008 03:12 PM
Script to display number of lines and words from a file newbewie Shell scripting 2 07-12-2007 10:37 PM
UNIX Display or list number of files in a current directory raj Getting started tutorials 1 07-12-2007 10:55 AM
Display Linux kernel information sweta Getting started tutorials 0 27-07-2007 07:00 AM
SuSe 10.0 doesn't recognize dual processors lacloai Linux software 6 21-07-2007 11:55 PM


All times are GMT +5.5. The time now is 11:18 PM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

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 37 38