简体   繁体   中英

how to sort wmic process according to the memory size

How to sort the wmic process get name, workingsetsize result according to the memory size for example it gives

sdf.exe  123
dfg.exe  3456
fgh.exe  234

what I want is

dfg.exe  3456
fgh.exe  234
sdf.exe  123

This will give you html output sorted (and as a convenience, display it immediately in the browser):

wmic process get name, workingsetsize /format:htable.xsl:"datatype=number":"sortby=WorkingSetSize" >table.html && table.html

(should be entered as single line at cmd prompt)

While I admit this is probably not exactly what you want it shows wmic output format extensibility and does not depend on any other tool/utility. If you need pure text output, you could for example tweak one of the included stylesheets or write your own xsl transform to format/sort the data. More information here: http://technet.microsoft.com/en-us/library/cc757287%28v=ws.10%29.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM