Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to execute a set of "piped" commands with altered niceness level. Example:

nice -n 15 command1 | command2 | command3

In this case niceness is altered to "15" only for command1. How to change it for the whole set of commands (command1, command2 and command3)?

share|improve this question
 nice -n 15 sh -c "command1 | command2 | command3"

This sets niceness of a subshell, and the commands 1..3 inherit it.

Edit: Sorry, the parenthesis will not do. There has to be a seperate shell invocation.

share|improve this answer
nice -n 15 command1 | nice -n <num> command2 | nice -n <num> command3

nice isn't used differently from any other command.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.