Created
June 2, 2022 08:41
-
-
Save PROGrand/1d3112132058afb663e8b2d621c4b36f to your computer and use it in GitHub Desktop.
How to get linux memory distribution per process
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ps -eo size,pid,user,command --sort -size | \ | |
awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' |\ | |
cut -d "" -f2 | cut -d "-" -f1 | less |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment