## Process Management

Every program running is a **Process**. Each has a unique **PID** (Process ID).

### Viewing Processes
1.  `ps`: List my processes.
2.  `ps aux`: List **ALL** processes from all users.
    *   **a**: All users.
    *   **u**: User/owner column.
    *   **x**: Processes not attached to a terminal (Daemons).
3.  `top`: Real-time task manager (CPU/RAM usage).
    *   Press `q` to quit.

### Killing Processes
Sometimes a program crashes or you need to stop a malicious script.
*   `kill [PID]`
    *   Example: `kill 1234` (Polite kill request. SIGTERM).
*   `kill -9 [PID]`
    *   **Force Kill**. (SIGKILL). The nuclear option. The kernel rips the process out of memory.

### Backgrounding
*   **Foreground**: `ping google.com` -> Takes over your terminal.
*   **Background**: `ping google.com &` -> Runs in background. Terminal is free.
*   **Ctrl+Z**: Pauses current process.
*   `bg`: Resumes paused process in background.
*   `fg`: Brings background process to foreground.

### Services (`systemctl`)
Daemons that start at boot (like Apace/Nginx).
*   `systemctl status apache2`
*   `systemctl start apache2`
*   `systemctl stop apache2`
*   `systemctl enable apache2` (Start on boot).