You can check CPU usage using several commands in the terminal. Here are a few common methods:
Using
topcommand:topThis command provides a real-time view of system processes and their CPU usage.
Using
htopcommand:htopIf you have
htopinstalled, it offers a more user-friendly interface for monitoring CPU usage and other system metrics.Using
mpstatcommand:mpstatThis command shows CPU usage statistics. You may need to install the
sysstatpackage to use it.Using
vmstatcommand:vmstat 1This command provides a snapshot of system performance, including CPU usage, updated every second.
Using
pscommand:ps aux --sort=-%cpu | headThis command lists processes sorted by CPU usage, showing the top CPU-consuming processes.
Choose any of these methods based on your preference and the tools available on your system.
