Thursday, April 23, 2020

Using Pipes in Powershell 7 on Debian 10

using get-process we get a detailed info of processes running

from that output if we only want to filter the output by just processname,id,ws we need to use

 get-process | select-object -Property processname,id,ws

to sort the output with a particular column like working set(ws) which lists processes based on memory usages in a ascending order


to see the same result in a descending manner

 get-process | select-object -Property processname,id,ws | sort-object -property ws -descending

to see the top 5 processes as they are consuming memory in a descending manner

get-process |  sort-object -property ws -descending | select-object -property processname,ws -first 5


No comments:

Post a Comment