Chapter 10. background, foreground, suspend

Hang on tight, my dweebs! In this chapter we’re going to “Bravely go where no Noobies have gone before.” We’ll fly into the background from the command-line interface, and return!

Here’s the background

Chapter 46, “Say What, Saytime,” includes a series of commands which cause your PC to speak the current time, wait 60 seconds, and then repeat. The command looked like this:

while true; do saytime; sleep 60; done &

See the ampersand? That’s the “&” thingy at the end of the line. It puts the task run by the commands above into the background, out of your way. That frees up the CLI so that you can do other things from there while the commands above are running. It’s part of the magic of multitasking, which is ...

Get CLI for Noobies: A Primer on the Linux Command Line 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.