Created
January 10, 2011 13:01
-
-
Save alkesh/772746 to your computer and use it in GitHub Desktop.
Find total memory usage for matching processes
This file contains 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
#!/usr/bin/env ruby | |
command = %(ps aux| awk '/.*#{ARGV[0]}.*/{total+=$6}END{print total/1024, "Mb"}') | |
total_mem = `#{command}` | |
puts total_mem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment