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.

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:



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
This will save you a pipe Tai leis sutaupyti vamzdis
grep -c processor /proc/cpuinfo grep-c processor / proc / cpuinfo
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.
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
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
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