A small command line system monitor for Linux, written in Go.
It shows CPU, RAM, and disk usage. You can check them once, or watch them update live on screen. Usage percentages are coloured green, yellow, or red so you can see the state at a glance.
You need Go 1.26 or newer.
git clone https://github.com/yourname/pcmon.git
cd pcmon
go build -o pcmon .
To run it from anywhere:
sudo mv pcmon /usr/local/bin/
pcmon <command>
| Command | Output |
|---|---|
cpu |
CPU usage |
ram |
Total, used, and percentage of memory |
disk |
Total, used, and percentage of / |
status |
All three, once |
watch |
All three, updating every second |
processes [n] |
The processes using the most memory |
watch keeps running until you stop it with Ctrl+C.
processes shows 8 by default. Pass a number to change it, for example
pcmon processes 20.
| Usage | Colour |
|---|---|
| under 60% | green |
| 60% to 85% | yellow |
| 85% and up | red |
The binary is statically linked, so the other machine needs nothing installed:
CGO_ENABLED=0 go build -ldflags="-s -w" -o pcmon .
Copy it across, run chmod +x pcmon, and it works. For a Raspberry Pi or
another ARM machine, build it with GOARCH=arm64. You do not need any extra
tools for that.
- Linux only in practice. It builds on other systems, but
diskreads/. - Disk numbers cover the root filesystem only. A separate partition such as
its own
/homeis not shown. - The first CPU reading of a run is
0.0%, because there is no earlier sample to compare it with. Every reading after that one is accurate.
gopsutil for reading the system values.
MIT. See LICENSE.
