A lightweight, interactive, high-performance Linux Command-Line Task Manager written in standard C++. It interacts directly with the Linux Kernel via the /proc pseudo-filesystem to monitor active processes and manage them using POSIX system signals.
- Engine Refactoring (From Tokenization to Stream Parsing): Upgraded the
/proc/[PID]/statusparser by replacing the old word-by-word stream extraction (statusFile >> word) with an advancedstd::getline()andstd::string::find()implementation.- Why this matters: The old method was prone to tokenization misalignment and high CPU overhead. The new
getlinestream-based approach scans memory structures line-by-line via the kernel buffer, dramatically increasing extraction speed and mitigating parsing dead-ends.
- Why this matters: The old method was prone to tokenization misalignment and high CPU overhead. The new
- Zero-Dependency: Standard C++ library only.
- Kernel Direct-Access: Reads directly from the
/procfilesystem. - PID Mapping: Identifies active processes.
- Interactive CLI Interface: Real-time process monitoring with custom action loops (Refresh/Exit).
- Process Management: Send kernel signals (
SIGKILL) to terminate any task instantly via PID. - Smart Memory Auto-Scaling: Displays memory consumption dynamically in Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, or Petabytes based on real usage.
- Crash Resilience: Built-in exception handling to survive dynamic kernel thread shifts.
- Discovery: Scans the
/procdirectory for PID-named folders usingdirent.h. - Filtering: Uses
isdigit()to isolate system processes. - Extraction: Parses
/proc/[PID]/statusto retrieve the process name and RAM usage (VmRSS). - Interactivity: Captures user input to safely dispatch POSIX signals or trigger dynamic terminal redraws using
system("clear").
When you run the application, you will interact with a clean terminal:
- OS: Linux-based operating systems (Tested on Arch Linux).
- Compiler: Clang or GCC/G++ with C++17 support or higher.
# 1. Clone the repository
git clone https://github.com/sudoRebel/linux-task-manager && cd linux-task-manager
# 2. Compile using Clang++ with C++17
clang++ -std=c++17 -I include src/*.cpp -o linux-task-manager
# 3. Run the application with root privileges
sudo ./linux-task-manager