Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 648 Bytes

how-to-control-cores-via-bash-command.md

File metadata and controls

35 lines (24 loc) · 648 Bytes

How to control cores via bash command

I learned from this page.

Disable specific cores

Disable core 0:

$ sudo -i
root# echo 0 >/sys/devices/system/cpu/cpu0/online

Disable core7 to core47:

$ sudo -i
root# for i in $(seq 7 47); do echo 0 >/sys/devices/system/cpu/cpu$i/online; done

Enable specific cores

Enable core 0:

$ sudo -i
root# echo 1 >/sys/devices/system/cpu/cpu0/online

Enable core7 to core47:

$ sudo -i
root# for i in $(seq 7 47); do echo 1 >/sys/devices/system/cpu/cpu$i/online; done