Take the 2-minute tour ×
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.

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.

share|improve this question
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 at 18:19

2 Answers 2

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

share|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.

share|improve this answer

Your Answer

 
discard

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.