Reputation: 71
Hopefully, this question can be resolved, as I've been searching all over the web for answers to no avail. Does Cygwin have a command to display cpu % of a Windows process? I know that the command top
can display this information, but it only displays Cygwin processes and not Windows. There's another command, ps
, but this doesn't display cpu %. Perhaps there's a command that has the best of both top
and ps
.
Upvotes: 2
Views: 3207
Reputation: 1
This works for me in cygwin, to check if any audio is playing:
t1=`/cygdrive/c/windows/system32/tasklist /fi "ImageName eq audiodg.exe" /v /nh`
(remove the "/nh" to see column headers)
(Actually, this only returned the total cpu usage. But i put it in a loop in a script w/ 'date +%s to get the time, and then calculated the percentage.)
Upvotes: 0
Reputation: 25411
Well, you don't need "native" Cygwin application to do that, because Cygwin can execute also native Windows' executables. In fact, Cygwin's "native" executables are Windows' native executables. They just use Cygwin's DLLs to map Linux system calls to Windows' ones.
Just use for example package PsTools from SysInternals (now part of Microsoft). It contains pslist which is able to output running Windows' processes information.
Upvotes: 1