nice sudo or sudo nice?

Nicolas Laplante asked:

is there any difference between running an intensive task over sudo with the following commands?:

  1. nice sudo [intensive command here]
  2. sudo nice [intensive command here]

BTW this is for Linux 3.x.

My answer:


If you run nice sudo then the prompt for your password will also be niced, but since you’ll spend far more time typing it, it really doesn’t matter much.

As ThoriumBR noted, if you are lowering the priority, then the order is irrelevant, but if you want to raise the priority, then (since this must be done as root) you must use sudo nice.

Otherwise I can’t imagine any real difference.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.