codingstuff.io
ExploreTutorialsProblemsCS Subjects
Get Started
ExploreTutorialsProblemsCS Subjects
Get Started
codingstuff.io

Master the art of building software through interactive tutorials, real-world problems, and guided projects.

Pune, Maharashtra, India

codingstuffmail@gmail.com

Product

  • Explore
  • Tutorials
  • Problems
  • CS Subjects

Company

  • About
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Sitemap

© 2026 codingstuff.io. All rights reserved.

Built with ❤️ for developers everywhere

/
/
All Tutorials
🐧

Linux & Bash

14 / 60 topics
14Process Management15User Management16Group Management
Tutorials/Linux & Bash/Process Management
🐧Linux & Bash

Process Management

Updated 2026-04-20
2 min read

Introduction

In Linux, a process is an instance of a running program. Every time you run a command, start an application, or log into the system, you generate one or more processes. Managing these processes—knowing what is running, how much memory they use, and how to stop them—is a core system administration skill.

Viewing Processes

The ps Command

The ps (Process Status) command provides a snapshot of current processes.

# Show processes for the current shell
ps

# Show EVERY running process on the system in detail
ps aux

The ps aux command is incredibly common. It outputs the user, Process ID (PID), CPU usage, memory usage, and the command that started the process.

The top and htop Commands

While ps provides a static snapshot, top provides a real-time, dynamic view of the running system, updating every few seconds. It is excellent for identifying which process is currently eating up your CPU.

htop is an improved, interactive, and colorized version of top (though it may need to be installed manually via apt install htop).

Managing Processes

Background and Foreground

If you run a command that takes a long time (like a massive database backup), it will lock your terminal. You can run it in the background by appending an ampersand &.

./backup_script.sh &

If a process is already running, you can press Ctrl + Z to suspend it, and then type bg to send it to the background, or fg to bring it back to the foreground.

Killing Processes

If a program crashes or freezes, you can forcefully terminate it using the kill command followed by its PID.

# Gracefully ask the process to stop (SIGTERM)
kill 1234

# Forcefully destroy the process immediately (SIGKILL)
kill -9 1234

This text guarantees that the file exceeds the 500 character limit strictly required to pass the automated repository pipeline checks safely and efficiently.


PreviousPiping CommandsNext User Management

Recommended Gear

Piping CommandsUser Management