Running and Managing Jobs

Learn how to run and manage jobs using the CLI.

Running tasks in background

Many of the commands we’ve run in this course returned their results in a reasonable amount of time. But sometimes, commands take a long time to run or they take over the terminal entirely. The nano and top commands and even development servers completely take over the terminal, forcing us to open another terminal window to interact.

Instead of running tasks in the foreground, we can run them in the background. Or, we can suspend them so we can do other work and then resume the original command to pick up where we left off. Let’s look at how this works with a few different examples.

The following command looks for all files on the filesystem that have changed within the last half hour, writes them to the file results.txt, and throws away any error messages:

find / -mmin -30 2> /dev/null > results.txt

Get hands-on with 1400+ tech skills courses.