3. Process Management

3.1. Finding info about a process

There are two tools used to find info about running processes: ps and top

3.2. Signals

3.3. Nice and priorities

Tip

If you want to run a process without hogging 99% of the CPU and upset other users, nice is for you.

A process is usually run with the priority of its parent. To know your shell's priority type:
nice

To run a niced command type:
nice my_command
It will (by default) add 10 to your shell's priority and define it as the process' priority. If your shell's priority is 0, your new process will have priority of 10.

To specify the nice-level (relative to current shell's priority):
nice -n 14
so the priority of the new process will be current_shell_priority+14.

3.4. Renice a job's priorities

To renice a job's priority, use renice.
renice +5 my_pid

You can also specify "all the processes of a user":
renice +20 -u patient_guy
This will add 20 to the priority of all patient_guy's processes. (you usually need to be root to do this, and to be able to run fast :-)