#!/bin/bash set -uo pipefail cd /home/rafa/joomla-migration/mirror-antiguo/restore/web for d in anterior ediciones music sport docs images media templates; do if [ -d "$d" ]; then printf '%-12s ficheros=%-8s php=%-6s html=%-7s %s\n' "$d" \ "$(find "$d" -type f | wc -l)" \ "$(find "$d" -iname '*.php' | wc -l)" \ "$(find "$d" -iname '*.htm*' | wc -l)" \ "$(du -sh "$d" | cut -f1)" else printf '%-12s (no existe)\n' "$d" fi done echo "--- indice de /anterior ---" ls anterior 2>/dev/null | head -20