Say I have launched a couple of non-timecritical applications such as a text editor a web browser etc and one more time critical (audio)application.

Is there a utility that simulates the opposite of nice by increasing nice value for all my other process or do I need to write a script for that.

  • 1
    What other processes? Do you want to increase the nice value for all but one process? Could you be more specific? You know you can use renice to increase or decrease the nice value of a running job right? – terdon Jan 20 '14 at 18:19

Surely there must be a better way than this, but on most Linux-based systems:

ps -o pid -C pidgin --no-headers --deselect

will give you all pids on the system, apart from those for the command pidgin, so

renice -n 5 $(ps -o pid -C pidgin --no-headers --deselect)

will try to renice everything butpidgin, but fail for processes you don't own

| improve this answer | |

I realize this is not quite answering the question from a nice perspective, but would it be more helpful to completely stop the unused programs by suspending them? From what you describe the programs are interactive, rather than batch processes etc. and there is no need to have them consume any resource if they are unused.

You could use:

kill -STOP <pid>

and resume again with:

kill -CONT <pid>

If the program is running in a shell terminal ctrl-Z suspends the program, and fg (foreground) plus the job number, resumes.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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