[cc lang=”bash” escaped=”true” width=”600″]

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 "" }'| head -10 1243.09 Mb /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-error=/var/log/mysql/error.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306 1151.62 Mb /usr/bin/python /usr/bin/fail2ban-server -b -s /var/run/fail2ban/fail2ban.sock -p /var/run/fail2ban/fail2ban.pid 255.69 Mb /usr/bin/tor --defaults-torrc /usr/share/tor/tor-service-defaults-torrc --hush 217.24 Mb /usr/sbin/rsyslogd -n 168.89 Mb /usr/sbin/named -f -u bind 122.74 Mb /usr/sbin/apache2 -k start 122.64 Mb /usr/sbin/apache2 -k start 120.48 Mb /usr/sbin/apache2 -k start 120.45 Mb /usr/sbin/apache2 -k start [/cc]

script it

this way you can pass it how many processes you would like to view – it auto updates every 3 seconds.

[cc lang=”bash” escaped=”true” width=”600″]
vim /scripts/mon_ram.sh

#!/bin/bash

while true ; do

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 "" }'| head -$1 sleep 3; clear; done [/cc]

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin