cputilx

Learning ncurses those days, so I wrote a command line tool which used to manage CPU. It is quite a simple program, but it still cost me about 4 hours to code, because I’m not so familiar with curses API.

When you perform this tool, it will print your machine information at first line. And the second line is the CPU info table's header, including Use, CPU, Type, Subtype, Slot.

Use column is used to describe whether the CPU is working or not.
CPU column tells you this core is a master one or a slave one.
Type column shows this processor’s brand.
Subtype column gives this core’s arch.
And Slot column presents the slot number of this processor.

On my MacBook Pro, it presents as following.

Darwin MacBook-Pro.local 13.3.0 x86_64
Use CPU Type Subtype Slot
YES Master Intel 80486 0
YES Slave Intel 80486 1
YES Slave Intel 80486 2
YES Slave Intel 80486 3
YES Slave Intel 80486 4
YES Slave Intel 80486 5
YES Slave Intel 80486 6
YES Slave Intel 80486 7

Usage

Type : in your terminal to enter control mode.

In control mode, for example, if you want to switch off number 2 processor, you should type off 2  and press return key. If you want to switch off 4, 5, 6 processor, you can do off 4 5 6 in control mode. If you wanna switch on one or more processors, just change the word off  to on . For convenient, on all and off all command are provided.
You can download this tool here.

声明: 本文为0xBBC原创, 转载注明出处喵~

发表评论

电子邮件地址不会被公开。 必填项已用*标注