Controlling job priority with nice

Suppose you need an enormous file from the Internet that would take practically all afternoon to download. By downloading it, you would hog system resources and make the system response time much slower for other users. OK, bad example. Suppose your coworker needs to download an enormous file and would hog system resources all afternoon. You'd hope that she'd have the courtesy to not tie up system resources that you need to use.

Fortunately, she can, using nice, which lets her control job priority. As Code Listing 9.8 shows, you rank your job's priority using numbers from 1 to 19, with 1 being somewhat nice and 19 being fabulously nice. The UNIX system uses the number you provide to determine how much attention ...

Get Unix: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.