We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Kill

Sometimes a program is in such a bad state (or is so malicious) that it doesn't respond to the SIGINT, in which case the best option is to use another shell session (new terminal window) to manually kill the program.

Syntax

kill <PID>

PID stands for "process ID." Every process that's running on your machine has a unique ID. The ps, "process status" command can be used to list the processes running on your machine, and their IDs:

ps aux

The "aux" options just mean "show all processes, including those owned by other users, and show extra information about each process."

Assignment

You did some digging and found out that the malicious program actually has another mode: force.

  1. ./malicious.sh force
    
  2. Don't include terminal control text like ^C.

  3. You will probably get 2 results: one for the malicious program, and one for the grep command itself. Make sure you use the correct PID, and that you don't miss any characters. You don't want to accidentally kill a system-critical process.

  4. kill <PID>
    

Tip

Run ps aux | head -n 1 to see the header row of the ps aux table.