How to use nice command?

Dear Friends,

I have a directory when i take du of that directory it takes alot of memory and cpu and I/O, i want to use nice to run my script that have du command slowly so it won't take I/O and cpu, please suggest.

man nice

is just one page long.

nice /path/to/myscript.sh

or

nice -n 15 /path/to/myscript.sh

To know something about scheduling policy and niceness, which are very different things:
man 2 sched_setscheduler (at least for a Linux system).

Then:

man chrt
man nice

Then keep in mind that with regard to I/O you should use the ionice command:
man ionice
--
Bye

is it ok if i use ionice in such a way, please confirm.


ionice -c3 -p pid

Sure. Of course run ionice with the right user. If du is run as root, use root for ionice too.
You know how to find the PID of your running du, don't you? With top, for instance.
--
Bye

Thanks, but normal use ionice not allowed is there some restrictions..........

Stick with using nice. No need to use ionice.