How-to Emulate the TOP command in Windows

Top is a Linux process that shows a list of processes running on the system and what levels of resources are being used. This application provides all processes running, the CPU and Memory consumed and with several switches available you can see things like the location of the executable that is running.

Unfortunately, they don’t make a TOP executable ported for Microsoft Windows but don’t despair.   You can

Top is a Linux process that shows a list of processes running on the system and what levels of resources are being used. This application provides all processes running, the CPU and Memory consumed and with several switches available you can see things like the location of the executable that is running.

Unfortunately, they don’t make a TOP executable ported for Microsoft Windows but don’t despair.   You can use Power Shell to script a simple TOP style display that operates just like TOP on a Linux system.

 

Here is the one liner you need to get a top style process viewer running on windows.

while (1) { ps | sort -desc cpu | select -first 30; sleep -seconds 2; cls }

 

Copy the above line and paste it in to your Power Shell console. You should see something similar to the following image.

7 thoughts on “How-to Emulate the TOP command in Windows”

  1. Can u explain this in a little more detail like what is the exact information being displayed in each column here and can I write the results to some text file and can this command be configured to execute after a given interval automatically

  2. Can u explain this in a little more detail like what is the exact information being displayed in each column here and can I write the results to some text file and can this command be configured to execute after a given interval automatically

  3. This is NOT a top emulation. The CPU information returned by get-process is the TOTAL time for a process since the system start. The top command give the current CPU load. Top is much more useful than this one liner.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.