Se eu entendi corretamente, o comando pode ser
$ grep GET access.log | awk '{print $7}' | cut -d '?' -f 1 | sort | uniq -c | sort -r -n -k 1 | head -10
114179 /bitrix/spread.php
13208 /bitrix/tools/public_session.php
11945 /
4393 /accessories/cases/
2268 /search/
2079 /ajax/actions.php
1951 /shop/
1591 /search
1388 /apple-watch/
1267 /apple-iphone/iphone-6s/
o comando mostrará os 10 links mais visitados. Se você realmente precisa de todos os links basta remover 'head -10'.
Para arquivos gz, você pode usar o seguinte
$ zcat access.log.gz | grep GET | awk '{print $7}' | cut -d '?' -f 1 | sort | uniq -c | sort -r -n -k 1 | head -10
And no there isn't a single command which will complete your task in one line
você está errado, um script de linha. Pipelines no bash são realmente poderosos;)
# zcat -f -- /var/log/httpd/* | grep GET | awk '{print $7}' | cut -d '?' -f 1 | sort | uniq -c | sort -r -n -k 1 | head -10 | awk '{SUM+=$1;print $0} END{print "Total hits: "SUM}'
15249 /sites/all/modules/lightbox2/js/lightbox.js
173 /scripts/template/
128 /libs/bundler.php
125 /libs/jquery.min.js
60 /vSample
Total hits: 15735
Mais script universal
#!/bin/bash
readonly LOG_DIR='/var/log/nginx'
readonly TOPS=5
readonly METHOD='GET|POST'
/bin/zcat -f -- ${LOG_DIR}/* | grep -E "${METHOD}" | awk '{print $7}' | cut -d '?' -f 1 | sort | uniq -c | sort -r -n -k 1 | head -${TOPS} | awk '{SUM+=$1;print $0} END{print "Total hits: "SUM}'
Resultado do teste
# ./tops.sh
15249 /sites/all/modules/lightbox2/js/lightbox.js
173 /scripts/template/
128 /libs/bundler.php
125 /libs/jquery.min.js
60 /vSample
Total hits: 15735