I want to find the specific file types in a particular directory. Once the file type got matched I need to delete the file. As I have used the below codes but it does not work. Could you suggest solution for this?
directory=/var/log/myFiles
if [ -d $directory ]
then
for file in $directory/*
do
if [ -f $file ]
then
if [$file==*.log.1]
then
rm file
fi
fi
done
fi