Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14

Thread: Display number of processors on linux

  1. #1
    Contributors
    Join Date
    Jun 2005
    Location
    London, UK
    Posts
    208
    Thanks
    0
    Thanked 1 Time in 1 Post
    Rep Power
    9

    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

  2. #2
    Senior Member B!n@ry's Avatar
    Join Date
    Dec 2006
    Location
    B!n@ry-z0ne
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default

    tom,

    the cmd top does not display the # of processors !!!
    LivE Free 0r DiE
    L!nux rul3z aLL

  3. #3
    Senior Member raj's Avatar
    Join Date
    Jun 2005
    Location
    Hyderabad
    Posts
    565
    Thanks
    57
    Thanked 40 Times in 37 Posts
    Rep Power
    13

    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

  4. #4
    Senior Member B!n@ry's Avatar
    Join Date
    Dec 2006
    Location
    B!n@ry-z0ne
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    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

  5. #5
    Junior Member
    Join Date
    Dec 2007
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    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

  6. #6
    Member
    Join Date
    Mar 2008
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    7

    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

  7. #7
    Junior Member
    Join Date
    Aug 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    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

  8. #8
    Never say die nixcraft's Avatar
    Join Date
    Jan 2005
    Location
    BIOS
    Posts
    4,498
    Thanks
    17
    Thanked 788 Times in 506 Posts
    Rep Power
    10
    All [Solved] threads are closed by mods / admin to avoid spam issues. See Howto mark a thread as [Solved]


  9. #9
    Junior Member
    Join Date
    Dec 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    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; 20th December 2008 at 01:48 PM.

  10. #10
    Never say die nixcraft's Avatar
    Join Date
    Jan 2005
    Location
    BIOS
    Posts
    4,498
    Thanks
    17
    Thanked 788 Times in 506 Posts
    Rep Power
    10

    Default

    You need to only type:
    Code:
    grep -c processor /proc/cpuinfo
    All [Solved] threads are closed by mods / admin to avoid spam issues. See Howto mark a thread as [Solved]


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 19th January 2008, 03:12 PM
  2. Script to display number of lines and words from a file
    By newbewie in forum Shell scripting
    Replies: 2
    Last Post: 7th December 2007, 10:37 PM
  3. UNIX Display or list number of files in a current directory
    By raj in forum Getting started tutorials
    Replies: 1
    Last Post: 7th December 2007, 10:55 AM
  4. Display Linux kernel information
    By sweta in forum Getting started tutorials
    Replies: 0
    Last Post: 27th July 2007, 07:00 AM
  5. SuSe 10.0 doesn't recognize dual processors
    By lacloai in forum Linux software
    Replies: 6
    Last Post: 21st July 2007, 11:55 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •