# htop
> An interactive process viewer for Unix

## Summary
Interactive process viewer and system monitor. A much better top with mouse support, tree view, filtering, and easy process management.

## Capabilities
- Interactive process list with sorting and filtering
- Tree view showing parent-child process relationships
- CPU, memory, and swap usage meters
- Search and filter processes
- Send signals (kill, terminate) to processes
- Mouse support for navigation
- Customizable meters and layouts

## When to Use
- Monitoring system resource usage
- Finding and killing resource-hungry processes
- Investigating system performance issues
- Need an overview of running processes

## When NOT to Use
- Need machine-parseable process data (use ps)
- Automated monitoring (use prometheus/grafana)
- Need historical performance data

## Usage Patterns
### Launch interactive viewer
```
htop
```
Opens the interactive process viewer

### Filter by user
```
htop -u username
```
Show only processes owned by a specific user

### Sort by memory
```
htop --sort-key=PERCENT_MEM
```
Launch sorted by memory usage

## Input / Output
- **stdout**: Interactive TUI (no meaningful stdout when piped)

## Installation
- **homebrew**: `brew install htop`
- **apt**: `sudo apt install htop`
- **pacman**: `sudo pacman -S htop`

## Related Tools
- [btop](/tools/btop) (alternative): btop is a more modern alternative with GPU monitoring

---
Source: https://littlescripts.sh/tools/htop
