Meet Glances, a New and Improved TOP

Top is a Linux/Unix command line program that displays all of the PC’s tasks and processes. If you ever used CNTRL-ALT-DEL and a Windows computer to start the task manager, then you’re already somewhat familiar with the program.

TOP displays current information about the PC in use, and provides “Process ID’s” in your terminal. It’s pretty simple to run, and comes pre-packaged in most Linux distributions.

Here is an example screenshot of TOP.

Screenshot of TOP/UNIX/LINUX
Top is mono-colored but dynamically refreshed

As you can see for yourself, the single colored text is hard to decipher, but if you look hard enough you can see the following:

  • Current commands being run
  • Whose running them
  • The percentage of CPU a task is using
  • The process ID number
  • Nice Level and PR (The importance of a task)
  • Memory usage
  • Time

These are all vital pieces of information for anyone debugging their current Linux distribution. Killing a process ID unfreezes just about any program, unlike Windows task manager which fails 50% of the time.

But TOP’s UI isn’t UF (user-friendly). Its boring to look at, and its lack of syntax highlighting adds another layer of complexity to a already complex screen.

HTOP, which was released on Github in 2014, is an attempt to liven up the screen with color, syntax highlighting, and artwork depicting memory usage.

HTOP. a improved version of TOP (go panoramic for better view if on mobile)

The information presented is coded with color, and shows extra figures such as the “memory bar” on top which dynamically moves.

Everything’s there, and the color is better than the original top, but the refresh rate is high, and using the grep command to filter processes takes a while.

Now, there’s a Python library that tackles the issue of Proccess management in Linux once and for all.

[visual-link-preview encoded=”eyJ0eXBlIjoiZXh0ZXJuYWwiLCJwb3N0IjowLCJwb3N0X2xhYmVsIjoiIiwidXJsIjoiaHR0cHM6Ly9naXRodWIuY29tL25pY29sYXJnby9nbGFuY2VzIiwiaW1hZ2VfaWQiOjY4NSwiaW1hZ2VfdXJsIjoiaHR0cDovLzEwMDBkYXlzb2Zjb2RlLmNvbS93cC1jb250ZW50L3VwbG9hZHMvMjAxOC8wNy9nbGFuY2VzLXJlc3BvbnNpdmUtd2ViZGVzaWduLnBuZyIsInRpdGxlIjoiR2xhbmNlcyAtIEFuIGV5ZSBvbiB5b3VyIHN5c3RlbSIsInN1bW1hcnkiOiJHbGFuY2VzIGlzIGEgY3Jvc3MtcGxhdGZvcm0gbW9uaXRvcmluZyB0b29sIHdoaWNoIGFpbXMgdG8gcHJlc2VudCBhIGxhcmdlIGFtb3VudCBvZiBtb25pdG9yaW5nIGluZm9ybWF0aW9uIHRocm91Z2ggYSBjdXJzZXMgb3IgV2ViIGJhc2VkIGludGVyZmFjZS4gVGhlIGluZm9ybWF0aW9uIGR5bmFtaWNhbGx5IGFkYXB0cyBkZXBlbmRpbmcgb24gdGhlIHNpemUgb2YgdGhlIHVzZXIgaW50ZXJmYWNlLiIsInRlbXBsYXRlIjoiZGVmYXVsdCJ9″]

Glances/HTOP/TOP/Linux
Glances in action

The program is pretty awesome. The user interface is pleasant, it provides more information than TOP, and HTOP, it’s responsive to its current container, and even offers a web-browser version allowing users to bookmark the tab, and visit the link inside their own native browser.

Its also way faster with the GREP command. For example, running “glances | grep root” to see all processes run by root, the results are instant and accurate. It can also run on rooted androids, which is always fun to look at.

 

Glances, written by /u/nicolargo is a great package that every system admin should take a look at.

Glances/TOP/HTOP/Linux
Glances is easily piped to different programs such as grep. (go panoramic for better view if on mobile)

Happy coding!

 

 

 

You Might Also Like

Leave a Reply

Your email address will not be published. Required fields are marked *