Tag Archive: proc

A C++ program to get CPU usage from command line in Linux

CPU usage from command line in Linux

This article explains how to create a simple program¬†in C++ that shows the current CPU usage from command line in Linux. That’s achieved processing the file /proc/stat which contains several¬†kernel/system statistics.