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 Displej Počet procesorov na Linuxe

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. Ak ste práve inovovali Linux box, alebo vás zaujíma, koľko procesorov vzdialený server, je to rýchle a špinavé príkaz môžete použiť na zobrazenie počtu procesorov.

On Linux, /proc/cpuinfo contains all of the processor information for all current processors in your computer. Na Linuxe, / proc / cpuinfo obsahuje všetky informácie o procesore pre všetky súčasné procesory v počítači. This will include the speed, the amount of on-chip cache, processor type, and how many cores. To bude zahŕňať rýchlosť, množstvo on-chip cache, typ procesora, a koľko jadra.

Here's the command: Tu je príkaz:

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. Príkaz len vyzerá v / proc / cpuinfo súbor, vytiahne počet riadkov, ktoré obsahujú slovo "spracovateľ" a odovzdáva ich do wc (word count), ktorá vracia počet procesorov v systéme.

Here's what it returned on my remote server: Tu je to, čo som sa vrátil na vzdialenom serveri:

[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. Všimnite si, že ak máte dual-core procesor, vráti každé jadro ako samostatný procesor. You can look at the full output of cat /proc/cpuinfo to see if the chips are dual-core. Môžete sa pozrieť na plný výkon na cat / proc / cpuinfo, či sú čipy dual-core.

This article was originally written on 02/22/07 Tagged with: Tento článok bol pôvodne napísaný na 02/22/07 Tagged s: Suse Linux Suse Linux , , Ubuntu Ubuntu

Daily Email Updates Denný Svářeč

You can get our how-to articles in your inbox each day for free. Môžete si naše jak-na články vo vašej schránky každý deň zadarmo. Just enter your name and email below: Stačí zadať svoje meno a e-mail nižšie:


Name: Meno:
Email: E-mail:

Comments (6) Komentáre (6)

  1. Rayz Rayz

    Hi, Nazdar,
    this will give you the same result and saves you having to type a couple of characters to vám dá rovnaký výsledok a uloží by ste museli zadať pár znakov

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

  2. Nate Nate

    This will save you a pipe Tým sa ušetrí potrubia
    grep -c processor /proc/cpuinfo grep-c processor / proc / cpuinfo

  3. Paul Boddie Paul Boddie

    Won't this count CPUs with hyperthreading twice? Nebude tento počet procesorov s hyperthreading dvakrát? My computer has one Pentium 4 (Prescott) CPU, but has two processor entries in cpuinfo. Môj počítač má jeden Pentium 4 (Prescott) CPU, ale má dva procesory položiek v cpuinfo.

  4. odor zápach

    Well… Sorry to say that it doesn't work most of the time. No ... Ospravedlňujem sa to povedať, že to nefunguje, väčšinu času. 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. Vedľa multithreadin procesory, je bežné, že vstup na jeden procesor je viac výskyt slova "spracovateľ" (ako v procesore identifikátor a názov modelu.
    On my ancient pemtium M laptop it reports 2 processors because ist modelname is “Intel(R) Pentium(R) M processor 1.73GHz”. Na mojej starej pemtium laptop M sa 2 procesory správy, pretože je ist ModelName "Intel (R) Pentium (R) M processor 1.73GHz".

    This might help: To by mohlo pomôcť:
    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 Ak chcete získať počet fyzických procesorov, tieto diela počíta unikátne fyzikálno-ids
    grep “physical id” /proc/cpuinfo |sort -u|wc -l grep "physical id" / proc / cpuinfo | sort-u | wc-l

  6. Alex Alex

    This comment I wrote may also help you (it's actually for Linux): Tento komentár som napísal, môže tiež pomôcť (je to vlastne pre Linux): http://www.howtogeek.com/howto.....ment-64380 http://www.howtogeek.com/howto.....ment-64380


Leave a Comment Zanechať komentár




Leave your Zanechajte svoj friendly priateľský comment here. komentár tu.

If you have a computer help question, Ak máte počítač pomôže otázku, click here to leave it on the forums kliknite tu nechať to na fórach instead. miesto.

Note: Your comment may not show up immediately on the site. Poznámka: Váš komentár sa nezobrazia okamžite na mieste.

Our Friends Naši priatelia
Getting Started Začíname


About How-To Geek O tom, ako-To Geek
What Is That Process? Čo je to za proces?
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.