LNMP常用系统命令

[查看lnmp参数]
查看nginx编译参数:/usr/local/nginx/sbin/nginx -V
查看apache编译参数:cat /usr/local/apache2/build/config.nice
查看mysql编译参数:cat /usr/local/mysql/bin/mysqlbug | grep CONFIGURE_LINE
查看php编译参数:/usr/local/php/bin/php -i | grep configure 

[统计网站访问最多IP]
# cat /data/backup/log/20151106_web3_access.log | cut -d " " -f 1-3 |sort |uniq -c |sort -rn |head
# cat  /data/backup/log/20151106_web3_access.log  | awk '{print $7}' | sort | uniq -c | sort -k1 -nr |head -n10

注释
cut -d " " -f 1        -d用空格分割,-d取分割后的第一列   
sort                    排序
uniq -c               统计重复的行,-c在重复的行前面显示重复次数
sort -nr               -n数字排序,-r求逆
head                    取前十行(默认)

猜你喜欢

转载自blog.csdn.net/wangshui898/article/details/82491787