Managing Processes in Linux


 Introduction

Processes are running programs in Linux. As a system administrator, you need to monitor, control, and manage processes to keep the system stable and efficient.


Step 1: View Running Processes

Use the ps command to see active processes.


ps aux


➡️ This shows all processes with details like PID, user, and CPU usage.


Step 2: Real-Time Process Monitoring

Use top to see processes updating live.


top


➡️ Press q to quit.


For a more advanced tool, use:


htop


(You may need to install htop first.)


Step 3: Kill a Process

If a process misbehaves, terminate it with its PID.


kill -9 PID


➡️ Replace PID with the process ID number.


Step 4: Check Process Tree

View parent/child process relationships:


pstree


➡️ This helps understand how processes are spawned.


Step 5: Background and Foreground Jobs


Run a process in the background:



command &


Bring a job to the foreground:


fg


List jobs:


jobs


Conclusion

Process management is essential for keeping Linux systems responsive and stable. Next, we’ll cover Linux services and systemd basics.

Comments