cat <your_file> | cut -d "/" -f 3 | sort | uniq -c | sort -rg | head -n <N> | awk '{print $2}'
Com:
-
cut -d "/" -f 3
: extrair strings "path2" -
sort | uniq -c | sort -rg
: conta ocorrências de cada string "caminho2" e classifica -
head -n <N> | awk '{print $2}'
: imprima primeiro N