How can I use --nice=-10 with cp command in linux ?
Following are the example when I tried the option and it gives the error unrecognized option EX- error:
cp --nice=-20 -r dir1 /d/
cp: unrecognized option `--nice=-20'
Try `cp --help' for more information.
nice
is a command on its own, it isn't an option to thecp
command.From
man nice
:So for your purposes, you would use this:
With
cp
you may be more I/O-limited than CPU-limited. To adjust the I/O priority, you can use theionice
command - seeman ionice
. For example, to get 'Best effort' priority with highest preference among all best effort processes, runYou can also combine it with
nice
to adjust both CPU and I/O priority: