Last active
November 5, 2024 23:21
-
-
Save AgustinParmisano/ff85752c5c74eb203f9e1a9a879fc7de to your computer and use it in GitHub Desktop.
tp final sistemas operativos 2024 isfdyt210
This file contains 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
#!/bin/bash | |
if [ $# -ne 2 ]; then | |
echo "Se requieren 2 parametros: {string} {directorio}" | |
exit 2 | |
fi | |
peso=$(ls -l $2 | grep "$1" | awk -F' ' '{sum+=$5;} END{print sum;}') | |
cant=$(ls -l | tail -n +2 | grep -c t) | |
ext=$(ls -l | grep $1 | awk -F"." '{ print $2 }' | sort | uniq -c | sort | tail -1) | |
echo "Cantidad de archivos encontrados: $cant" | |
echo "Peso total de los archivos: $peso" | |
echo "Formato más común: $ext" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment