Thursday, April 23, 2015

administration userful linux commands

ps -ylC php5-fpm --sort:rss | awk '!/RSS/ { s+=$8 }
END { printf "%s\n", "Total memory used by PHP-FPM child processes: "; printf "%dM\n", s/1024 }'

ls -1R | wc -l shows number of files in folder.

sudo cat /var/log/nginx/site_access.log | awk '{ print $1 }' | sort | uniq -c | sort -n ( This command will count how many times any given IP has hammered your site).

No comments: