3. Process Details

Before diving into the practical applications of process management, it's essential to understand what Linux processes are and how they function. This topic can seem complex as we explore the details, so feel free to revisit this lesson later if needed.

What is a Linux Process

A process is a program in execution. More precisely, it is an instance of a running program to which the system has allocated resources like memory, CPU time, and I/O. For example, if you open three terminal windows, run the cat command in two of them without any arguments (it will wait for standard input, keeping the process active), and then use the third window to run ps aux | grep cat, you will see two distinct cat processes. Each is a separate instance of the same program, with its own unique process ID and resource allocation.

The Kernel's Role in Process Management

The Linux kernel is responsible for all process management. When you execute a program, the kernel loads its code into memory, allocates necessary system resources, and begins tracking it as a process. The kernel maintains detailed information for each process, including:

  • The status of the process
  • The resources the process is using and receives
  • The process owner
  • Signal handling (more on that later)
  • And basically everything else

All active processes compete for system resources. The kernel acts as a scheduler, ensuring that each process receives a fair share of resources based on its priority and needs. When a process completes its task or is terminated, the kernel reclaims the resources it was using, making them available for other processes.

Sign in to save your learning progress

Sign in

Exercises

Practice makes perfect! Here are some hands-on labs to reinforce your understanding of Linux processes and their management:

  1. Manage and Monitor Linux Processes - Learn essential skills for managing and monitoring processes on a Linux system, including interacting with foreground/background processes, inspecting with ps, monitoring with top, and terminating with kill.
  2. Linux top Command: Real-time System Monitoring - Learn to use the top command for real-time system monitoring, including sorting processes, adjusting update intervals, and filtering by user.
  3. Linux free Command: Monitoring System Memory - Learn to use the free command to monitor and analyze system memory usage, understanding how the kernel allocates resources to processes.

These labs will help you apply the concepts in real scenarios and build confidence with process management in Linux.

Quiz

What manages and controls all Linux processes? Please answer in a single English word, all lowercase.