top Command Generator
Generate top commands to display Linux processes
Getting Started with top
## What is top?
The `top` command shows a live, updating view of running processes sorted by CPU usage, along with system summary stats (load, memory, swap). It's the standard interactive process monitor on Linux.
## How to Use
1. **Pick Update Mode**: Run interactively, or enable `-b` (batch) for scripting. 2. **Set Interval (optional)**: Use `-d` to control how often the display refreshes. 3. **Filter (optional)**: Limit to a PID (`-p`) or a user (`-u`). 4. **Copy & Run**: Copy the generated command into your terminal. Press `q` to quit the interactive view.
Common Options
### `-b` Batch mode Disable the interactive UI and print updates to stdout as plain text. Essential for piping output to a file or script (e.g. logging CPU stats over time).
### `-d` Delay Set the refresh interval in seconds. `top -d 2` updates every 2 seconds. Fractional values like `0.5` are allowed.
### `-p` Monitor PID Show only the specified process ID. Useful for tracking a single daemon's resource usage.
### `-u` Filter by user Display only processes owned by the given user (e.g. `top -u www-data`).
### `-H` Thread mode Show individual threads instead of aggregated processes. Each thread gets its own row, revealing which thread inside a process is busy.
▶How do I log top output to a file?
▶How do I sort by memory instead of CPU?
▶Why does top show different numbers than ps?
If this tool has been helpful to you, consider buying me a coffee.
Buy me a coffee