How do you list all processes on the command line in Windows?
Is there a command equivalent to 'ps' on Unix that can list all processes on a Windows machine?
Working with cmd.exe:
tasklist
If you have Powershell:
get-process
Via WMI:
wmic process
(you can query remote machines as well with /node:ComputerOrIP
, and there are a LOT more ways to customize this command: link)
There is a tool called Windows Management Instrumentation Command-line tool (wmic.exe).
You can call wmic process list
to see all processes.
I wanted to mention that WMIC (pam's entry) can do a lot more. Have a look at my WMIC snippets page, which is a cheatsheet showing many of the common ways to use WMIC (with sample output shown) here
Tasklist
WMIC /OUTPUT:C:\ProcessList.txt PROCESS get Caption,Commandline,Processid
or
WMIC /OUTPUT:C:\ProcessList.txt path win32_process get Caption,Processid,Commandline
I tried on Windows 7. The command is: TASKLIST /FI "IMAGENAME eq application_name"
Eg: c:\>TASKLIST /FI "IMAGENAME eq notepad.exe"
To show all process with port details:
c:\> TASKLIST
Also to kill the process you can use c:\> pskill or tskill processname
Eg: c:\> tskill notepad