Skip to content

Instantly share code, notes, and snippets.

@alexcmd
Created January 13, 2020 13:47
Show Gist options
  • Save alexcmd/05c9adc2285828bb1bad1e89624e8a16 to your computer and use it in GitHub Desktop.
Save alexcmd/05c9adc2285828bb1bad1e89624e8a16 to your computer and use it in GitHub Desktop.
Get process list ordered by memory usage
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