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 Prikaži Number of Processors na 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. Če ste šele vzpenjajoč se svoj Linux box, ali pa se sprašujejo, koliko procesorjev oddaljeni strežnik je, da je hiter in umazano ukaz, ki ga lahko uporabite za prikaz števila procesorjev.

On Linux, /proc/cpuinfo contains all of the processor information for all current processors in your computer. On Linux, / proc / cpuinfo vsebuje vse predelovalca informacij za vse sedanje procesorjev v računalniku. This will include the speed, the amount of on-chip cache, processor type, and how many cores. To bo vključevalo hitrosti, količine predpomnilnika na čipu, vrsta procesorja, in koliko jeder.

Here's the command: Tukaj je ukaz:

cat /proc/cpuinfo | grep processor | wc -l cat / proc / cpuinfo | grep procesor | 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. Ukaz šele pogled v / proc / cpuinfo datoteke, potegne ven število vrstic, ki vsebujejo besedo "obdelovalec" in jih preda v wc (besedo count), ki vrne število od procesorjev v sistemu.

Here's what it returned on my remote server: Evo, kaj je vrnil na svoj oddaljeni strežnik:

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

4 4

Note that if you have a dual-core processor, it will return each core as a separate processor. Upoštevajte, da če imate dual-core procesor, se bo vrnitev vsako jedro kot ločen procesor. You can look at the full output of cat /proc/cpuinfo to see if the chips are dual-core. Si lahko ogledate celotno proizvodnjo cat / proc / cpuinfo da vidim, če so čipi dual-core.

This article was originally written on 02/22/07 Tagged with: Ta članek je bil prvotno napisan na 02/22/07 Tagged with: Suse Linux SuSE Linux , , Ubuntu Ubuntu

Daily Email Updates Dnevni Email Updates

You can get our how-to articles in your inbox each day for free. Lahko dobite našo kako do člankov v vašo mapo »Prejeto vsak dan brezplačno. Just enter your name and email below: Preprosto vpišite vaše ime in e-pošto spodaj:


Name: Ime:
Email: E-pošta:

Comments (6) Komentarji (6)

  1. Rayz Rayz

    Hi, Živjo,
    this will give you the same result and saves you having to type a couple of characters to vam bo dal enak rezultat in Vam prihrani skrb za vrsto nekaj znakov

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

  2. Nate Nate

    This will save you a pipe Tako boste prihranili cev
    grep -c processor /proc/cpuinfo grep-c procesor / proc / cpuinfo

  3. Paul Boddie Paul Boddie

    Won't this count CPUs with hyperthreading twice? Ali ni to število procesorjev z HyperThreading dvakrat? My computer has one Pentium 4 (Prescott) CPU, but has two processor entries in cpuinfo. Moj računalnik ima eno Pentium 4 (Prescott) CPU, vendar je dva procesorja vpisov v cpuinfo.

  4. odor vonj

    Well… Sorry to say that it doesn't work most of the time. No ... Žal mi je povedati, da to ne deluje večino časa. 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. Poleg multithreadin procesorji, je skupno, da je vstop na enem procesorju ima več pojav besede "obdelovalec" (tako v procesor identifikator in ime modela.
    On my ancient pemtium M laptop it reports 2 processors because ist modelname is “Intel(R) Pentium(R) M processor 1.73GHz”. Na moji stari pemtium laptop M poroča 2 procesorja, saj ist modelname je "Intel (R) Pentium (R) M procesor 1.73GHz".

    This might help: To bi lahko pomagal:
    grep -c ^processor /proc/cpuinfo grep-c ^ procesor / proc / cpuinfo

  5. Ron Ron

    To get the count of physical CPUs, this works by counting the unique physical ids Če želite število fizičnih procesorjev, to dela s štetjem edinstveno telesno ids
    grep “physical id” /proc/cpuinfo |sort -u|wc -l grep "fizični id" / proc / cpuinfo | sort-u | wc-l

  6. Alex Alex

    This comment I wrote may also help you (it's actually for Linux): Ta komentar sem napisal lahko tudi vam pomaga (to je dejansko za Linux): http://www.howtogeek.com/howto.....ment-64380 http://www.howtogeek.com/howto.....ment-64380


Leave a Comment Pustite komentar




Leave your Pustite friendly prijazen comment here. comment here.

If you have a computer help question, Če imate računalnik pomagati vprašanje, click here to leave it on the forums kliknite tukaj, da ga pustijo na forumih instead. namesto.

Note: Your comment may not show up immediately on the site. Opomba: Tvoj komentar morda ne pokažejo takoj na mestu.

Our Friends Naši prijatelji
Getting Started Getting Started


About How-To Geek O Kako naj Geek
What Is That Process? Kaj je to 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.