Display Number of Processors on Linux Tampilkan Jumlah Prosesor di 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. Jika Anda baru saja meng-upgrade Linux anda, atau anda bertanya-tanya berapa banyak prosesor server remote, ada yang cepat dan perintah kotor dapat Anda gunakan untuk menampilkan jumlah prosesor.
On Linux, /proc/cpuinfo contains all of the processor information for all current processors in your computer. Di Linux, / proc / cpuinfo berisi semua informasi prosesor untuk semua prosesor saat ini di komputer Anda. This will include the speed, the amount of on-chip cache, processor type, and how many cores. Ini akan mencakup kecepatan, jumlah on-chip cache, tipe prosesor, dan berapa banyak core.
Here's the command: Berikut perintah:
cat /proc/cpuinfo | grep processor | wc -l cat / proc / cpuinfo | grep prosesor | 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. Perintah hanya tampak di / proc / cpuinfo file, mengeluarkan jumlah baris yang mengandung kata "prosesor" dan melewati mereka ke wc (word count), yang kembali hitungan dari CPU dalam sistem.
Here's what it returned on my remote server: Berikut adalah apa yang kembali pada remote server:
[root@root]# cat /proc/cpuinfo | grep processor | wc -l [root @ root] # cat / proc / cpuinfo | grep prosesor | wc-l
4 4
Note that if you have a dual-core processor, it will return each core as a separate processor. Catatan bahwa jika Anda memiliki prosesor dual-core, hal itu akan kembali masing-masing inti sebagai prosesor yang terpisah. You can look at the full output of cat /proc/cpuinfo to see if the chips are dual-core. Anda dapat melihat output penuh cat / proc / cpuinfo untuk melihat apakah chip dual-core.

Daily Email Updates Harian Email Pembaharuan
You can get our how-to articles in your inbox each day for free. Anda bisa mendapatkan kita bagaimana-untuk artikel dalam kotak masuk Anda setiap hari secara gratis. Just enter your name and email below: Cukup masukkan nama dan email Anda di bawah ini:



Hi, Hai,
this will give you the same result and saves you having to type a couple of characters ini akan memberikan Anda hasil yang sama dan menyelamatkan Anda harus mengetikkan beberapa karakter
grep processor /proc/cpuinfo |wc -l grep processor / proc / cpuinfo | wc-l
This will save you a pipe Ini akan menghemat pipa
grep -c processor /proc/cpuinfo grep-c processor / proc / cpuinfo
Won't this count CPUs with hyperthreading twice? Tidak akan menghitung ini CPU dengan Hyperthreading dua kali? My computer has one Pentium 4 (Prescott) CPU, but has two processor entries in cpuinfo. Komputer saya memiliki satu Pentium 4 (Prescott) CPU, tetapi memiliki dua prosesor isian di cpuinfo.
Well… Sorry to say that it doesn't work most of the time. Yah ... Maaf untuk mengatakan bahwa tidak bekerja sebagian besar waktu. 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. Multithreadin samping prosesor, Ini adalah entri yang umum pada satu prosesor memiliki beberapa kemunculan kata "processor" (baik di Procesor pengenal dan nama model.
On my ancient pemtium M laptop it reports 2 processors because ist modelname is “Intel(R) Pentium(R) M processor 1.73GHz”. Dalam kuno pemtium M laptop itu laporan 2 processors karena ist ModelName adalah "Intel (R) Pentium (R) M Processor 1.73GHz".
This might help: Ini mungkin membantu:
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 Untuk mendapatkan hitungan CPU fisik, ini bekerja dengan menghitung fisik yang unik ids
grep “physical id” /proc/cpuinfo |sort -u|wc -l grep "id fisik" / proc / cpuinfo | sort-u | wc-l
This comment I wrote may also help you (it's actually for Linux): Komentar ini saya menulis juga dapat membantu Anda (sebenarnya untuk Linux): http://www.howtogeek.com/howto.....ment-64380 http://www.howtogeek.com/howto.....ment-64380