Last active
February 14, 2017 14:57
-
-
Save freyes/13c228ae14524bc8dcfc2cfde7c7bf4f to your computer and use it in GitHub Desktop.
print memory in megabytes
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/bash | |
| # source: http://php.ingewikkeld.net/entry/human-readable-memory-usage-in-linux-per-process | |
| ps -heo 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 "" }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment