Hello,
In REP directoy sometimes I have a lot of files
And it happened that the command
find . -name "*.xml" | xargs rm -f
didn't work because of file toot long
I proposed this script
nbre_fichier =`ls -l | wc -l`
If $nbre_fichier > 1500 # this is juste an example
then
cpteur=0
while $cpteur < $nbre_fichier
do
ls -lattr | head -100 | while read FILE
do
rm $FICHIER
cpteur=cpteur+1
done
elsif
ls -lattr | while read FILE
do
rm $FILE
done
fi
Xould you please give me your advice or suggestion
Thankx in advance
In REP directoy sometimes I have a lot of files
And it happened that the command
find . -name "*.xml" | xargs rm -f
didn't work because of file toot long
I proposed this script
nbre_fichier =`ls -l | wc -l`
If $nbre_fichier > 1500 # this is juste an example
then
cpteur=0
while $cpteur < $nbre_fichier
do
ls -lattr | head -100 | while read FILE
do
rm $FICHIER
cpteur=cpteur+1
done
elsif
ls -lattr | while read FILE
do
rm $FILE
done
fi
Xould you please give me your advice or suggestion
Thankx in advance