Display Number of Processors on Linux Wyświetlacz Ilość procesorów w systemie 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. Jeśli właśnie aktualizacji systemu Linux, czy zastanawiasz się, jak wiele procesorów zdalnego serwera, nie ma szybkie i brudne polecenia można używać do wyświetlania liczby procesorów.
On Linux, /proc/cpuinfo contains all of the processor information for all current processors in your computer. W systemie Linux / proc / cpuinfo zawiera wszystkie informacje procesor dla wszystkich obecnych procesorów w komputerze. This will include the speed, the amount of on-chip cache, processor type, and how many cores. Obejmie to prędkość, ilość pamięci podręcznej chip, typ procesora, a jak wiele rdzeni.
Here's the command: Oto polecenie:
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. Polecenia tylko patrzy w / proc / cpuinfo pliku, wyciąga numer linii zawierającej słowo "procesor" i przekazuje je do WC (liczba słów), która zwraca liczbę procesorów w systemie.
Here's what it returned on my remote server: Oto, co zwróciło na moim zdalnym serwerze:
[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. Zauważ, że jeśli masz dwurdzeniowy procesor, zwróci każdego rdzenia jako osobny procesor. You can look at the full output of cat /proc/cpuinfo to see if the chips are dual-core. Można spojrzeć na pełne wyjście z cat / proc / cpuinfo aby sprawdzić, czy frytki są dwurdzeniowe.

Daily Email Updates Daily Email Updates
You can get our how-to articles in your inbox each day for free. Możesz pobrać nasze instrukcje postępowania w skrzynce odbiorczej codziennie za darmo. Just enter your name and email below: Wystarczy podać swoje imię i adres e-mail:



Hi, Cześć,
this will give you the same result and saves you having to type a couple of characters to daje takie same rezultaty, i oszczędza konieczności wpisywania para znaków
grep processor /proc/cpuinfo |wc -l grep procesora / proc / cpuinfo | wc-l
This will save you a pipe Pozwoli to zaoszczędzić rury
grep -c processor /proc/cpuinfo grep-c procesora / proc / cpuinfo
Won't this count CPUs with hyperthreading twice? Czy nie jest to liczba procesorów z HyperThreading dwa razy? My computer has one Pentium 4 (Prescott) CPU, but has two processor entries in cpuinfo. Mój komputer ma jeden procesor Pentium 4 (Prescott) procesora, ale ma dwa procesory wpisy cpuinfo.
Well… Sorry to say that it doesn't work most of the time. Cóż ... Niestety powiedzieć, że nie działa większość czasu. 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. Obok multithreadin procesory, to jest, że wejście na jeden procesor ma wiele wystąpienia słowo "procesor" (zarówno w procesorze identyfikator i nazwa modelu.
On my ancient pemtium M laptop it reports 2 processors because ist modelname is “Intel(R) Pentium(R) M processor 1.73GHz”. Na moim laptopie starożytnych pemtium M to raporty 2 procesory, ponieważ ist ModelName jest "Intel (R) Pentium (R) M processor 1.73GHz.
This might help: To może pomóc:
grep -c ^processor /proc/cpuinfo grep-c ^ procesora / proc / cpuinfo
To get the count of physical CPUs, this works by counting the unique physical ids Aby otrzymać liczbę fizycznych procesorów, to działa, licząc unikalnych identyfikatorów fizycznych
grep “physical id” /proc/cpuinfo |sort -u|wc -l grep "physical id" / proc / cpuinfo | sort-u | wc-l
This comment I wrote may also help you (it's actually for Linux): Ten komentarz napisałem może również pomóc (jest to tak naprawdę dla Linuksa): http://www.howtogeek.com/howto.....ment-64380 http://www.howtogeek.com/howto.....ment-64380