How can I use the "nice" command in combination with the "parallel" command to set the priority level of multiple processes in Linux?

I have tried the following:

nice -n 3 parallel command ::: arg1 arg2 arg3 arg4
parallel --nice 19 command ::: arg1 arg2 arg3 arg4

but it does not seem to be working: the code runs, but the niceness level does not seem to be applied to the processes being run in parallel.

Any suggestions on how to correctly use the nice command with parallel?

1

There are 1 best solutions below

1
On

update:

you can use:

parallel --jobs 5 command ::: arg1 

I am pretty sure the above comment is from Chat GPT. :/