Top – system monitor
The system utility top is included in most (if not all) Linux distributions. It’s a handy way to see the CPU usage, memory usage, and active processes — for example, if you remotely log into a Linux box and want to issue commands rather than using graphical tools, top will allow you to quickly see information about the hardware usage. Color terminals are supported, and sorting of columns by CPU usage, memory usage, etc. is available. Use “?” to query the available commands within top. A screenshot is below:
A similar useful utility that is usually not installed by default but available with most distributions is htop. htop is similar to top but with a bar-type representation of CPU, memory, and swap usage. Use the Function keys to customize htop:
Lastly, if you want to see CPU and memory usage (as well as other) information while in a shell, screen may be for you, if you are running Ubuntu with the screen-profiles package installed. screen actually has a lot more useful features:
- Ability to run multiple “windows”, so you don’t need multiple terminal windows running at once. In screen, “Ctrl-a n” allows you to switch to the next window, so you can just use 1 screen but have multiple sessions (this is useful if you use PuTTY from Windows to log into a Linux server but don’t want to have to run 2 separate PuTTY sessions). The ability to copy/paste text from one session to another is also present, which is quite handy!
- Ability to “detach” and “resume” a session. Useful if you remotely log into a Linux server from one machine (e.g., at work) but want to later log into the same Linux server from another machine (e.g., from home)
Here is a screenshot of “screen” (ignore the text in the screen, which is just random output from ls -al — the bottom info shows the CPU/memory info I referred to above).
Comments are closed.