Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pcmon

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.

Install

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/

Usage

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.

Example

pcmon watch running

Colours

Usage Colour
under 60% green
60% to 85% yellow
85% and up red

Building for another machine

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.

Notes

  • Linux only in practice. It builds on other systems, but disk reads /.
  • Disk numbers cover the root filesystem only. A separate partition such as its own /home is 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.

Built with

gopsutil for reading the system values.

Licence

MIT. See LICENSE.

About

A small command line system monitor for Linux, written in Go.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages