My utils
Eliminar con barra de progreso
Section titled “Eliminar con barra de progreso”# Opción 1: Con pv (requiere instalar pv)rm -rv carpeta | pv -l -s $(find carpeta -type f -printf x | wc -c) > logfile
# Opción 2: Barra simple en Bash (sin pv)total=$(find carpeta -type f | wc -l)count=0find carpeta -type f -print0 | while IFS= read -r -d '' archivo; do rm "$archivo" ((count++)) echo -ne "Progreso: $count / $total\r"doneecho ""⚠️ Precaución: rm -rf es definitivo. Siempre verifica el directorio antes de ejecutar.
Encontrar procesos que consumen mucha memória
Section titled “Encontrar procesos que consumen mucha memória”ps aux --sort=-%mem | head -10Consultar IP pública
Section titled “Consultar IP pública”curl ifconfig.mecurl ipinfo.io/ipcurl -s https://api.ipify.orgBackup con fecha
Section titled “Backup con fecha”cp archivo.txt archivo-$(date +%Y%m%d).txt