Pour lister les fichiers *Vtba*.e non vides dans /exploit/logs/
find /exploit/logs/ -type f -size +1 -exec ls -lh {} \; | awk '{ print $8 ": " $5 }' |grep ".*\Vtba.*\.e"
Pour supprimer les fichiers trouvés
find /exploit/logs/ -type f -size +1 -exec ls -lh {} \; | awk '{ print $8 }' |grep ".*\Vtba.*\.e" | xargs rm
#!/bin/bash cpt=0 cd /exploit/logs lfic=$(find *.e -type f -not -empty) for wfic in ${lfic} do sed '/ERR_NOCONN/d' ${wfic} > ${wfic}_old mv ${wfic}_old ${wfic} done efic=$(find *.e -type f -not -empty) for vfic in ${efic} do echo "Le fichier : "${vfic} echo "contient : " cat ${vfic} echo "" cpt=$(($cpt+1)) done exit ${cpt}