0
0
Linux CLIscripting~15 mins

jobs command in Linux CLI - Mini Project: Build & Apply

Choose your learning style9 modes available
Using the jobs Command to Manage Background Processes
📖 Scenario: You are working in a Linux terminal and want to manage multiple tasks running in the background. You need to see which tasks are running, stopped, or in the background.
🎯 Goal: Learn how to use the jobs command to list background and stopped jobs in the current shell session.
📋 What You'll Learn
Start a background job using &
Use the jobs command to list jobs
Understand job states like Running and Stopped
💡 Why This Matters
🌍 Real World
Managing multiple tasks in the terminal without closing the shell is common for developers and system administrators.
💼 Career
Knowing how to control background jobs helps in multitasking and efficient use of the command line.
Progress0 / 4 steps
1
Start a Background Job
Run the command sleep 30 & to start a background job that waits for 30 seconds.
Linux CLI
Need a hint?

Use & at the end of the command to run it in the background.

2
Start Another Background Job
Run the command sleep 60 & to start another background job that waits for 60 seconds.
Linux CLI
Need a hint?

Use & to run the second sleep command in the background as well.

3
List All Background Jobs
Use the jobs command to list all background jobs and their statuses.
Linux CLI
Need a hint?

Simply type jobs and press Enter to see the list of jobs.

4
Display the Output of the jobs Command
Run the script and observe the output of the jobs command showing the background jobs.
Linux CLI
Need a hint?

The output should list two jobs with their job numbers and status as Running.