Created
January 15, 2017 11:57
-
-
Save raulmoyareyes/610e58579cda2370699103198834c9ba to your computer and use it in GitHub Desktop.
Useful commands for apache log and folders.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# IPs distintas y peticiones | |
cat access.log | awk '{print $1}' | sort -n | uniq -c | sort -nr | head -30 | |
# Peticiones al dia | |
zcat access.log-*.gz | awk '{print substr($4, 2, 11)}' | sort -n | uniq -c | |
# Total de peticiones sumadas de todos los dias | |
zcat access.log-*.gz | awk '{print substr($4, 2, 11)}' | sort -n | uniq -c awk '{ sum += $1 } END { print sum }' | |
# Numero de peticiones a paginas (sin contar imagenes etc) | |
cat access.log | grep '/ HTTP/1.1" 200' | |
# Ver tamaño de una carpeta | |
du -sh | |
# Contar carpetas con nombre imagen en todo el arbol | |
du -h | grep -c image |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment