Skip to content

Instantly share code, notes, and snippets.

@adpande
Created November 19, 2022 22:03
Show Gist options
  • Save adpande/70654acfb616846b6ad6430e6300b90d to your computer and use it in GitHub Desktop.
Save adpande/70654acfb616846b6ad6430e6300b90d to your computer and use it in GitHub Desktop.
get memory of process in linux
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment