0
0
Linux CLIscripting~15 mins

Why process control manages running programs in Linux CLI - See It in Action

Choose your learning style9 modes available
Why Process Control Manages Running Programs
📖 Scenario: Imagine you are working on a Linux system where multiple programs run at the same time. You want to understand how the system keeps track of these programs and controls their execution.
🎯 Goal: You will create a simple script that lists running programs and shows how process control helps manage them.
📋 What You'll Learn
Create a variable called process_list that stores the output of the ps -e command.
Create a variable called filter_keyword with the value bash.
Use a command to filter process_list for lines containing filter_keyword and store the result in filtered_processes.
Print the filtered_processes variable to show running bash processes.
💡 Why This Matters
🌍 Real World
System administrators and users often need to check which programs are running and control them to keep the system stable and efficient.
💼 Career
Understanding process control is essential for roles like system administration, DevOps, and IT support where managing running programs is a daily task.
Progress0 / 4 steps
1
Create a variable with the list of running processes
Create a variable called process_list that stores the output of the command ps -e.
Linux CLI
Need a hint?

Use $(command) to capture the output of a command into a variable.

2
Create a filter keyword variable
Create a variable called filter_keyword and set it to the string bash.
Linux CLI
Need a hint?

Use double quotes to assign a string value to a variable.

3
Filter the process list using the keyword
Use the grep command to filter process_list for lines containing filter_keyword. Store the result in a variable called filtered_processes.
Linux CLI
Need a hint?

Use echo "$process_list" | grep "$filter_keyword" to filter lines.

4
Display the filtered running processes
Print the variable filtered_processes to show the running bash processes.
Linux CLI
Need a hint?

Use echo to display the contents of a variable.