Bird
Raised Fist0
Linux CLIscripting~20 mins

Why process control manages running programs in Linux CLI - Challenge Your Understanding

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Process Control Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Purpose of Process Control in Linux
Why does process control exist to manage running programs in Linux?
ATo increase the size of files on the disk automatically
BTo allow the system to start, stop, and monitor programs efficiently
CTo change the color scheme of the terminal interface
DTo permanently delete all user data without confirmation
Attempts:
2 left
💡 Hint
Think about what managing running programs means in terms of system resources.
💻 Command Output
intermediate
1:30remaining
Output of 'ps' Command
What is the output of the command ps -e | grep bash on a Linux system?
Linux CLI
ps -e | grep bash
ALists all running processes including those with 'bash' in their name
BShows the disk usage of the bash shell
CDisplays the contents of the bash configuration file
DDeletes all bash processes immediately
Attempts:
2 left
💡 Hint
The 'ps' command lists processes; 'grep' filters output.
📝 Syntax
advanced
1:30remaining
Correct Syntax to Kill a Process
Which command correctly stops a running process with PID 1234?
Akill 1234 -k
Bkill 1234 -9
Ckill -9 1234
Dkill -x 1234
Attempts:
2 left
💡 Hint
The signal option comes immediately after 'kill'.
🔧 Debug
advanced
1:30remaining
Why Does 'kill 1234 -9' Fail?
Given the command kill 1234 -9, why does it fail to stop the process?
ABecause 'kill' cannot stop processes
BBecause PID 1234 does not exist
CBecause '-9' is not a valid signal
DBecause the signal option '-9' must come before the PID
Attempts:
2 left
💡 Hint
Check the order of arguments in the kill command.
🚀 Application
expert
2:00remaining
Using 'top' to Identify High CPU Processes
You want to find which running program is using the most CPU on your Linux system. Which steps using the 'top' command will help you do this?
ARun 'top', then press 'P' to sort processes by CPU usage descending
BRun 'top', then press 'M' to sort processes by memory usage ascending
CRun 'top', then press 'T' to sort processes by time ascending
DRun 'top', then press 'Q' to quit immediately
Attempts:
2 left
💡 Hint
Look for the key that sorts by CPU usage in descending order.

Practice

(1/5)
1. What is the main purpose of process control in Linux?
easy
A. To manage running programs by starting, stopping, or pausing them
B. To install new software packages
C. To change the screen resolution
D. To create new user accounts

Solution

  1. Step 1: Understand process control basics

    Process control is about managing programs that are currently running on the system.
  2. Step 2: Identify the correct purpose

    Starting, stopping, and pausing programs are key actions in process control.
  3. Final Answer:

    To manage running programs by starting, stopping, or pausing them -> Option A
  4. Quick Check:

    Process control = Manage running programs [OK]
Hint: Process control means managing running programs [OK]
Common Mistakes:
  • Confusing process control with software installation
  • Thinking it manages hardware settings
  • Mixing it up with user account management
2. Which command is used to pause a running process in Linux?
easy
A. kill -9 <pid>
B. kill -STOP <pid>
C. kill -CONT <pid>
D. kill -TERM <pid>

Solution

  1. Step 1: Recall kill command signals

    The kill command sends signals to processes; -STOP pauses, -CONT resumes.
  2. Step 2: Identify pause signal

    Signal -STOP pauses the process without terminating it.
  3. Final Answer:

    kill -STOP <pid> -> Option B
  4. Quick Check:

    Pause process = kill -STOP [OK]
Hint: Use kill -STOP to pause a process [OK]
Common Mistakes:
  • Using kill -9 which forcefully kills the process
  • Confusing -CONT (resume) with pause
  • Using kill -TERM which terminates the process
3. What will be the output of the command sequence below?
sleep 100 &
jobs
kill -STOP %1
jobs
medium
A. Shows the job stopped both times
B. Shows no jobs running
C. Shows the job running, then shows it stopped
D. Shows an error because kill -STOP is invalid

Solution

  1. Step 1: Understand the commands

    sleep 100 & runs sleep in background; jobs lists jobs; kill -STOP %1 pauses job 1.
  2. Step 2: Predict jobs output

    First jobs shows sleep running; after kill -STOP, jobs shows it stopped.
  3. Final Answer:

    Shows the job running, then shows it stopped -> Option C
  4. Quick Check:

    jobs before and after kill -STOP = running then stopped [OK]
Hint: jobs shows status; kill -STOP pauses job [OK]
Common Mistakes:
  • Thinking kill -STOP kills the job
  • Expecting no jobs after sleep &
  • Believing kill -STOP is invalid
4. You run kill -STOP 1234 but the process does not pause. What is the most likely reason?
medium
A. You need to run the command as root
B. You used the wrong signal; should be kill -9
C. The process is already stopped
D. The process ID 1234 does not exist

Solution

  1. Step 1: Check process existence

    If the process ID does not exist, kill commands have no effect.
  2. Step 2: Consider other reasons

    Wrong signal or permissions cause errors, but no pause means no such process.
  3. Final Answer:

    The process ID 1234 does not exist -> Option D
  4. Quick Check:

    Nonexistent PID = no pause [OK]
Hint: Check if PID exists before sending signals [OK]
Common Mistakes:
  • Assuming kill -9 pauses process
  • Ignoring process existence
  • Thinking root is always required
5. You want to temporarily pause a script running in the background, then resume it later. Which sequence of commands correctly achieves this?
hard
A. kill -STOP <pid> to pause, then kill -CONT <pid> to resume
B. kill -TERM <pid> to pause, then kill -STOP <pid> to resume
C. kill -9 <pid> to pause, then restart the script manually
D. kill -CONT <pid> to pause, then kill -STOP <pid> to resume

Solution

  1. Step 1: Identify pause and resume signals

    kill -STOP pauses a process; kill -CONT resumes it.
  2. Step 2: Verify command sequence

    Pause with kill -STOP, then resume with kill -CONT is correct.
  3. Final Answer:

    kill -STOP <pid> to pause, then kill -CONT <pid> to resume -> Option A
  4. Quick Check:

    Pause = kill -STOP, Resume = kill -CONT [OK]
Hint: Pause with STOP, resume with CONT signals [OK]
Common Mistakes:
  • Using kill -9 which kills process
  • Mixing up STOP and CONT signals
  • Trying to resume with STOP signal
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard