Subscribe to How-To Geek Mag-subscribe sa Paano-Upang Geek

Important! This is an automatic machine translated page. If you can read english, you should Click Here to read the original English version of the article.

Display Number of Processors on Linux Ipakita ang Bilang ng mga processors sa Linux

If you've just upgraded your Linux box, or you are wondering how many processors a remote server has, there's a quick and dirty command you can use to display the number of processors. Kung lang mo-upgrade ang iyong Linux box, o kayo ay nagtataka kung gaano karami ang processors ng isang remote server, may isang mabilis at marumi command na maaari mong gamitin upang ipakita ang bilang ng mga processors.

On Linux, /proc/cpuinfo contains all of the processor information for all current processors in your computer. Sa Linux, / proc / cpuinfo ay naglalaman ng lahat ng mga processor na impormasyon para sa lahat ng kasalukuyang mga processors sa inyong computer. This will include the speed, the amount of on-chip cache, processor type, and how many cores. Ito ay kasama na ang bilis, ang halaga ng mga on-chip cache, processor uri, at kung gaano karaming cores.

Here's the command: Narito ang mga utos:

cat /proc/cpuinfo | grep processor | wc -l cat / proc / cpuinfo | grep processor | WC-l

The command just looks in the /proc/cpuinfo file, pulls out the number of lines containing the word “processor” and passes them into wc (word count), which returns a count of the CPUs in the system. Ang utos lamang ng tingin sa / proc / cpuinfo file, kinukuha ang bilang ng mga linya na naglalaman ng salitang "processor" at magbabalik sa kanila sa WC (salita count), na nagbalik sa isang bilang ng mga CPUs sa sistema.

Here's what it returned on my remote server: Narito ang kung ano ito bumalik sa aking remote server:

[root@root]# cat /proc/cpuinfo | grep processor | wc -l [root @ root] # cat / proc / cpuinfo | grep processor | WC-l

4 4

Note that if you have a dual-core processor, it will return each core as a separate processor. Tandaan na kung mayroon kang isang kambal-core processor, ito ay babalik sa bawat core bilang isang hiwalay na processor. You can look at the full output of cat /proc/cpuinfo to see if the chips are dual-core. Maaari mong tingnan ang buong output ng mga cat / proc / cpuinfo upang makita kung ang mga chips ay kambal-core.

This article was originally written on 02/22/07 Tagged with: Ang artikulong ito ay orihinal na isinulat sa 02/22/07 Tagged with: Suse Linux Suse Linux , , Ubuntu Ubuntu

Daily Email Updates Araw-araw na Updates Email

You can get our how-to articles in your inbox each day for free. Maaari kang makakuha ng aming kung-paano na mga artikulo sa iyong inbox sa bawat araw para sa libre. Just enter your name and email below: Ilagay lamang ang inyong pangalan at email sa ibaba:


Name: Pangalan:
Email: Email:

Comments (6) Comments (6)

  1. Rayz Rayz

    Hi, Hi,
    this will give you the same result and saves you having to type a couple of characters na ito ay magbibigay sa iyo ang parehong resulta at ini-imbak mo kinakailangang mag-type ng isang pares ng mga character

    grep processor /proc/cpuinfo |wc -l grep processor / proc / cpuinfo | WC-l

  2. Nate Nate

    This will save you a pipe Ito ay i-save ka ng isang tubo
    grep -c processor /proc/cpuinfo grep-c processor / proc / cpuinfo

  3. Paul Boddie Paul Boddie

    Won't this count CPUs with hyperthreading twice? Hindi ito count CPUs sa hyperthreading ng dalawang beses? My computer has one Pentium 4 (Prescott) CPU, but has two processor entries in cpuinfo. Ang aking computer ay isa sa Pentium 4 (Prescott) CPU, ngunit ay may dalawang entries processor sa cpuinfo.

  4. odor masarap na amoy

    Well… Sorry to say that it doesn't work most of the time. Well ... Ikinalulungkot namin na sabihin na hindi ito gumagana sa halos lahat ng oras. Beside multithreadin processors, It is common that entry on a single processor has multiple occurence of word “processor” (both in the procesor identifier and model name. Katabi ng multithreadin processors, Ito ay karaniwang ang entry na iyon sa isang solong processor ay may maramihang mga pangyayari ng salitang "processor" (pareho sa procesor identifier at modelo ng pangalan.
    On my ancient pemtium M laptop it reports 2 processors because ist modelname is “Intel(R) Pentium(R) M processor 1.73GHz”. Sa aking mga sinaunang laptop pemtium M ito ulat 2 processors dahil IST modelname ay "Intel (R) Pentium (R) M processor 1.73GHz".

    This might help: Ito ay maaaring makatulong:
    grep -c ^processor /proc/cpuinfo grep-c ^ processor / proc / cpuinfo

  5. Ron Ron

    To get the count of physical CPUs, this works by counting the unique physical ids Upang makuha ang bilang ng pisikal na CPUs, ito ay gumagana sa pamamagitan ng pagbibilang ng mga natatanging mga pisikal na mga id
    grep “physical id” /proc/cpuinfo |sort -u|wc -l grep "pisikal na id na" / proc / cpuinfo |-uri-uriin-u | WC-l

  6. Alex Alex

    This comment I wrote may also help you (it's actually for Linux): Ito comment ko wrote maaari ring makatulong sa iyo na (it's tunay na para sa Linux): http://www.howtogeek.com/howto.....ment-64380 http://www.howtogeek.com/howto.....ment-64380


Leave a Comment Iwanan ng isang Puna




Leave your Iwanan ang iyong mga friendly friendly comment here. puna dito.

If you have a computer help question, Kung ikaw ay may isang computer ng tulong tanong, click here to leave it on the forums i-click dito upang mag-iwan ito sa forums instead. sa halip ng.

Note: Your comment may not show up immediately on the site. Tandaan: Ang iyong puna ay maaaring hindi magpapakita agad sa site.

Our Friends Ang aming mga Friends
Getting Started Pagsisimula


About How-To Geek Tungkol sa Paano-Upang Geek
What Is That Process? Ano ba ang Proseso Iyon?
svchost.exe svchost.exe
jusched.exe jusched.exe
dwm.exe dwm.exe
ctfmon.exe ctfmon.exe
wmpnetwk.exe wmpnetwk.exe
wmpnscfg.exe wmpnscfg.exe
rundll32.exe rundll32.exe
wfcrun32.exe wfcrun32.exe
Ipoint.exe Ipoint.exe
Itype.exe Itype.exe
Wfica32.exe Wfica32.exe
Mobsync.exe Mobsync.exe
conhost.exe conhost.exe
Dpupdchk.exe Dpupdchk.exe Adobe_Updater.exe Adobe_Updater.exe

Copyright © 2006-2009 HowToGeek.com. Copyright © 2006-2009 HowToGeek.com. All Rights Reserved. All Rights Reserved.