Managing Processes

  • A Linux process can be in one of a few states:

    • running = the CPU is executing a process

      • CTRL+Z to stop the process from running

      • Linux sends a STOP signal to the process and the process enters the stopped state

    • sleeping = the process sleeps when it is waiting on a resource

    • zombie = the remains of processes that weren't properly cleaned up when they died

      • when a process dies, its parent process gets some information from the deceased process and then cleans everything up

      • a zombie process doesn't respond to the normal signals used to shut it down

  • The processes change their state in response to SIGNALS.

Commands

kill

  • kill - send a signal to a process

    • the default signal for kill is TERM

pkill

  • pkill - look up, signal, or wait for processes based on name and other attributes

    • It kills every process containing that name or attribute, pay attention!

sleep

  • sleep - delay for a specified amount of time

    • used for delays into bash scripting


Last updated

Was this helpful?