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.

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:



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
This will save you a pipe Tako boste prihranili cev
grep -c processor /proc/cpuinfo grep-c procesor / proc / cpuinfo
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.
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
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
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