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 Display Number of Processors 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. Ja esat tikko modernizētas jūsu Linux box, vai jums ir jautājums, cik procesori attālajā serverī ir, ka ir ātrs un netīrās komanda var izmantot, lai parādītu pārstrādātāju skaitu.

On Linux, /proc/cpuinfo contains all of the processor information for all current processors in your computer. Linux, / proc / cpuinfo satur visus procesora informācija par visiem esošajiem pārstrādātājiem datoru. This will include the speed, the amount of on-chip cache, processor type, and how many cores. Tas ietvers ātrumu, summa on-chip cache, procesora viedu un cik serdes.

Here's the command: Šeit ir komandu:

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. Komanda tikai izskatās in / proc / cpuinfo failu, atvelk no rindu skaitu, kas satur vārdu "pārstrādātājs" un nodod tos wc (Word count), kas atgriež skaits šajā sistēmā CPU.

Here's what it returned on my remote server: Lūk, kā tas atgriezās savā attālajā 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. Ņemiet vērā, ka, ja jums ir divkodolu procesors, tā atgriezīsies katru kodols kā atsevišķu procesoru. You can look at the full output of cat /proc/cpuinfo to see if the chips are dual-core. Jūs varat apskatīt pilnu izejas cat / proc / cpuinfo lai redzētu, vai mikroshēmas Dual-Core.

This article was originally written on 02/22/07 Tagged with: Šis pants tika sākotnēji rakstīts uz 02/22/07 tagged with: Suse Linux SUSE Linux , , Ubuntu Ubuntu

Daily Email Updates Daily Email Updates

You can get our how-to articles in your inbox each day for free. Jūs varat saņemt mūsu how-to rakstus savā pastkastītē katru dienu par brīvu. Just enter your name and email below: Vienkārši ievadiet jūsu vārdu un e-pasta zemāk:


Name: Vārds:
Email: E-pasts:

Comments (6) Komentāri (6)

  1. Rayz Rayz

    Hi, Čau,
    this will give you the same result and saves you having to type a couple of characters Tas dos Jums tādu pašu rezultātu un saglabā tev ierakstīt pāris characters

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

  2. Nate Nate

    This will save you a pipe Tas ietaupīs jums pipe
    grep -c processor /proc/cpuinfo grep-c processor / proc / cpuinfo

  3. Paul Boddie Paul Boddie

    Won't this count CPUs with hyperthreading twice? Nebūs šis skaits CPU ar hyperthreading divreiz? My computer has one Pentium 4 (Prescott) CPU, but has two processor entries in cpuinfo. Mans dators ir viens Pentium 4 (Prescott) CPU, bet ir divas procesoru ieraksti cpuinfo.

  4. odor smarža

    Well… Sorry to say that it doesn't work most of the time. Nu ... Piedodiet teikt, ka tas nedarbojas lielākā daļa laika. 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. Blakus multithreadin procesori ir skaidrs, ka ieraksts par vienu procesoru ir vairāki notikums vārdu "pārstrādātājs" (abas Procesor identifikators un modeļa nosaukumu.
    On my ancient pemtium M laptop it reports 2 processors because ist modelname is “Intel(R) Pentium(R) M processor 1.73GHz”. Uz manu seno pemtium M klēpjdators tas ziņo, 2 procesori, jo ist Modelis ZUIKO DIGITAL ir "Intel (R) Pentium (R) M processor 1.73GHz".

    This might help: Tas varētu palīdzēt:
    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 Lai iegūtu skaits fizisko CPU, tas, skaitot unikālo fizisko ID darbi
    grep “physical id” /proc/cpuinfo |sort -u|wc -l grep "fiziskā id" / proc / cpuinfo | sort-u | wc-l

  6. Alex Alex

    This comment I wrote may also help you (it's actually for Linux): Šo komentāru es uzrakstīju, arī var palīdzēt jums (tas patiesībā Linux): http://www.howtogeek.com/howto.....ment-64380 http://www.howtogeek.com/howto.....ment-64380


Leave a Comment Leave Comment




Leave your Atstājiet savu friendly draudzīgs comment here. komentārus šeit.

If you have a computer help question, Ja Jums ir dators palīdzēt jautājumu, click here to leave it on the forums click here to atstāt uz forumu instead. vietā.

Note: Your comment may not show up immediately on the site. Piezīme: Jūsu komentārs var neparādīties pat tieši uz vietas.

Our Friends Our Friends
Getting Started Getting Started


About How-To Geek Par How-To Geek
What Is That Process? Kas ir šis process?
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.