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 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.

This article was originally written on 02/22/07 Tagged with: Ten artykuł został napisany na 02/22/07 Tagged with: Suse Linux Suse Linux , , Ubuntu Ubuntu

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:


Name: Imię i nazwisko:
Email: E-mail:

Comments (6) Komentarze (6)

  1. Rayz Rayz

    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

  2. Nate Nate

    This will save you a pipe Pozwoli to zaoszczędzić rury
    grep -c processor /proc/cpuinfo grep-c procesora / proc / cpuinfo

  3. Paul Boddie Paul Boddie

    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.

  4. odor zapach

    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

  5. Ron Ron

    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

  6. Alex Alex

    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


Leave a Comment Zostaw komentarz




Leave your Zostaw swój friendly przyjazny comment here. komentarz.

If you have a computer help question, Jeśli masz pytanie pomocy komputera, click here to leave it on the forums Kliknij tutaj, aby pozostawić ją na forum instead. zamiast.

Note: Your comment may not show up immediately on the site. Uwaga: Twój komentarz nie pojawi się od razu na stronie.

Our Friends Nasi Przyjaciele
Getting Started Pierwsze kroki


About How-To Geek O How-To Geek
What Is That Process? Co to jest proces?
svchost.exe svchost.exe
jusched.exe jusched.exe
dwm.exe dwm.exe
ctfmon.exe Gadu-Gadu
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.