查看web访问日志各url shell

root@debian:~/Workspace# awk ‘ { if(match($7,"/*\.php*")) { if(index($7,"?")) { print substr($7,0,index($7,"?")) } else { print $7; } } } ‘ access.log | sort -d | uniq -c
      8 /allinone_beta_02/dma_14/index.php
    641 /allinone_beta_02/dma_15/index.php
    357 /allinone_beta_02/dma_16/index.php
    358 /allinone_beta_02/dma_17/index.php
      1 /allinone_beta_02/dma/index.php
   2539 /allinone_beta_02/index.php
    229 /allinone_beta_02/wechat/index.php
    219 /corporate_beta_10/index.php
      2 /corporate_beta10/index.php
      4 /corporate/index.php
      2 /ecshop/activity.php
     53 /ecshop/api/cron.php
      2 /ecshop/article.php
     22 /ecshop/captcha.php
     10 /ecshop/category.php
      8 /ecshop/flow.php
      1 /ecshop/gallery.php
     37 /ecshop/goods.php
      2 /ecshop/group_buy.php
      6 /ecshop/user.php
   4033 /wechat_beta_22/index.php
      4 /wechat_beta_27/index.php
     47 /wechat_beta_28/index.php

  可能不准确,不过大致不会错

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。