is there any difference between running an intensive task over sudo with the following commands?:
- nice sudo [intensive command here]
- sudo nice [intensive command here]
BTW this is for Linux 3.x.
linuxprocess-priorityroot
is there any difference between running an intensive task over sudo with the following commands?:
BTW this is for Linux 3.x.
Best Answer
There's a difference, a crucial one.
If you want to decrease the process' priority, the order does not matter. On the other hand, if you want to increase it, you must put
sudo
beforenice
.Since you are running the command as a normal user (otherwise you would not bother with sudo at all), you can only decrease the priority of your command. But if you use
sudo
first, you can increase it if you want.