Created
March 19, 2021 22:03
-
-
Save cerealskill/f09aee4ef0148134bee200dd620205d4 to your computer and use it in GitHub Desktop.
Dos procedimientos para recorrer archivos en Linux y obtiene el tamaño de cada file en una salida
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
#!/bin/bash | |
while IFS= read -r line | |
do | |
ls -Ral /var/www/$line | awk '{t+=$5}END{print t}' >> output_file_size.txt | |
done < lista_files.txt | |
##!/bin/bash | |
#while IFS= read -r line | |
#do | |
# du -h /var/www/$line >> output_file_size_mb.txt | |
#done < lista_files.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment