Una de bash, concatenació de comandes per calcular tamany ocupat

September 3, 2007 – 1:04 pm

Trivial i simple ordre per calcular el tamanay que ocupen un conjunt de directoris que compleixen un patró determinat.

pfreixes@hidrogen:tmp/#total_size=0;for f in `ls -d ???200705??`;
do size=`du --max-depth=1 $f|cut -f1`;
echo $f = $size; total_size=`expr $total_size + $size`; done;
echo "Total Size in Bytes $total_size";

Post a Comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word