How to set one task’s CPU affinity quickly? Posted on Mar 24, 2018 by Weiwei Jia In QA How to set one task’s CPU affinity quickly? 1, Get this task’s ID # taskset -pc PID 2, Set this task’s CPU affinity # taskset -c affinity ./task There is also another format # taskset -pc affinity pid For example: set process with PID 3783 to CPU 15 # taskset -pc 15 3783 Read more: I/O Microscopy: Tasks’ Disk I/O Information with High Accuracy How to quickly find out failed disks’ SATA port in Linux? (how to map Linux disk names to SATA ports) How to quickly find out which rpm package provides a command on Fedora Linux? How to merge git branches quickly and correctly Quickly Copying Text to a File How to get the CPU temperatur in command linux on Linux? How to limit a user’s CPU resources in Linux Systems Find out the number of CPU cores on Linux