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 Rodyti 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. Jei Jūs ką tik atnaujinote savo "Linux" langelį, ar norite žinoti, kiek perdirbėjai nuotolinio serverio, there's quick and dirty komandą galite naudoti ekrane perdirbėjų skaičių.

On Linux, /proc/cpuinfo contains all of the processor information for all current processors in your computer. Linux, / proc / cpuinfo yra visi perdirbėjo informaciją apie visus šiuo metu perdirbėjams kompiuterio. This will include the speed, the amount of on-chip cache, processor type, and how many cores. Tai apima greičio, dydžio on-chip cache, procesoriaus tipas, ir kiek gyslų.

Here's the command: Štai komandos:

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 atrodo tiesiog iš / proc / cpuinfo failą, išsitraukia iš eilučių, kuriose yra žodis "perdirbėjas" ir perduoda juos į WC (Word count), kuris grįžta iš sistemos CPU skaičius numerį.

Here's what it returned on my remote server: Štai ką jis grįžo į savo nuotolinio serverio:

[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. Atkreipkite dėmesį, kad jeigu turite Dual-Core procesorių, tai bus grąžinti kiekvieno atskiro branduolio procesoriaus. You can look at the full output of cat /proc/cpuinfo to see if the chips are dual-core. Galite pažvelgti į visą produkciją cat / proc / cpuinfo pamatyti jeigu lustai Dual-Core.

This article was originally written on 02/22/07 Tagged with: Šis straipsnis buvo parašytas ant 02/22/07 Tagged with: Suse Linux Suse Linux , , Ubuntu Ubuntu

Daily Email Updates Dienos paštas Atnaujinimai

You can get our how-to articles in your inbox each day for free. Galite gauti mūsų kaip prie straipsnių į Jūsų pašto dėžutę kasdien nemokamai. Just enter your name and email below: Tiesiog įveskite vardą ir elektroninio pašto adresą žemiau:


Name: Vardas:
Email: Paštas:

Comments (6) Komentarai (6)

  1. Rayz Rayz

    Hi, Labas,
    this will give you the same result and saves you having to type a couple of characters Tai suteiks jums patį rezultatą ir taupo jūsų atsižvelgdama į tipo ženklų pora

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

  2. Nate Nate

    This will save you a pipe Tai leis sutaupyti vamzdis
    grep -c processor /proc/cpuinfo grep-c processor / proc / cpuinfo

  3. Paul Boddie Paulius Boddie

    Won't this count CPUs with hyperthreading twice? Ar ne tas skaičius procesorių su Hyper-du kartus? My computer has one Pentium 4 (Prescott) CPU, but has two processor entries in cpuinfo. Mano kompiuteryje yra vienas Pentium 4 (Prescott) CPU, bet turi du procesorius įrašai cpuinfo.

  4. odor kvapas

    Well… Sorry to say that it doesn't work most of the time. Na ... Atsiprašau pasakyti, kad jis neveikia, didžiąją laiko dalį. 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. Šalia multithreadin perdirbėjams, yra žinoma, kad atvykti į vieną procesorių turi kelis atsiradimo Žodis "procesorius" (abi Procesorius identifikatorius ir modelio pavadinimas.
    On my ancient pemtium M laptop it reports 2 processors because ist modelname is “Intel(R) Pentium(R) M processor 1.73GHz”. Mano senovės pemtium M nešiojamas ji ataskaitos 2 procesoriai, nes ist modelname yra "Intel (R) Pentium (R) M processor 1.73GHz".

    This might help: Tai gali padėti:
    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 Gauti fizinių procesorių skaičius, tai skaičiuojant fizinio unikalų identifikatorių darbai
    grep “physical id” /proc/cpuinfo |sort -u|wc -l grep "fizinio ID" / proc / cpuinfo | sort-u | wc-l

  6. Alex Alex

    This comment I wrote may also help you (it's actually for Linux): Šis komentaras Parašiau taip pat gali padėti jums (it's actually Linux): http://www.howtogeek.com/howto.....ment-64380 http://www.howtogeek.com/howto.....ment-64380


Leave a Comment Palikite komentarą




Leave your Palikite friendly draugiškas comment here. komentarus.

If you have a computer help question, Jei turite kompiuteryje Pagalba klausimą, click here to leave it on the forums Spauskite čia, jei norite palikti jį dėl forumai instead. vietoj.

Note: Your comment may not show up immediately on the site. Pastaba: Jūsų komentaras gali būti rodomas iš karto svetainėje.

Our Friends Mūsų draugai
Getting Started Paruo


About How-To Geek Apie How-To Geek
What Is That Process? Kas yra šis procesas?
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.