+cpuset returns Permission Denied

I am trying to run “echo +cpuset > /sys/fs/cgroup/cgroup.subtree_control” in terminal, but either as the current user, or as root (sudo), I am getting permission denied.

ls -l cgroup.subtree_control                                                     ✔ 
-rw-r--r-- 1 root root 0 Jan  7 07:34 cgroup.subtree_control

Any ideas why or how to fix this?

How are you using sudo for this? My guess is (guessing because you didn’t give any information) that you run echo as sudo but the redirect as your normal user.

Yes, this is how I do it. So I should run it like this?
echo sudo +cpuset > /sys/fs/cgroup/cgroup.subtree_control
Is this correct?

Edit: Ok, I ran “su” first, and then the command, now it works.
That was easy. Thanks @mithrial

This is how I would do it, and it probably makes it a bit more intelligible:

echo "+cpuset" | sudo tee /sys/fs/cgroup/cgroup.subtree_control