Get Process CPU Usage Using WMI

I recently blogged about another method to obtain a process’ CPU usage via Command Line: Get CPU Usage of a Process from Command Line

Here’s a quick command line method for grabbing CPU usage of a process by process id, process name, or caption.

By Process ID

wmic path win32_perfformatteddata_perfproc_process where (IDProcess = '3488') get Name, Caption, PercentProcessorTime, IDProcess /format:list

byprocid

By Process Name

wmic path win32_perfformatteddata_perfproc_process where (Name='iexplore') get Name, Caption, PercentProcessorTime, IDProcess /format:list

byprocname

By Process Name (fuzzy)

wmic path win32_perfformatteddata_perfproc_process where (Name like '%iexp%') get Name, Caption, PercentProcessorTime, IDProcess /format:list

byprocnamefuzzy

Any processes with CPU time over 50%

wmic path win32_perfformatteddata_perfproc_process where (PercentProcessorTime ^> 50) get Name, Caption, PercentProcessorTime, IDProcess /format:list

bycputime

MySQL CLI Output Formatting Tips

I’m sure you’ve seen results similar to this on a standard query:

Now, if you use the \G option (Send command to mysql server, display result vertically.):

That makes reading the output from command line really nice.

One more tidbit that I’ve found I like to do is use the \p option (Print current command.) combined with \G for reference:

Got any other tips?  Leave a comment!

JavaScript Operating System

I knew it had to exist (laughing out loud), and I just found it.  A JavaScript operating system.  Anyone who knows me knows that I joke around about “creating a new operating system coded in JavaScript”… well, here it is:  JS/UIX

JS/UIX is an UN*X-like OS for standard web-browsers, written entirely in JavaScript (no plug-ins used). It comprises a virtual machine, shell, virtual file-system, process-management, and brings its own terminal with screen- and keyboard-mapping.

JS UX/UI
JS UX/UI Command Example

You can give JS/UIX a try here:  http://www.masswerk.at/jsuix/