Delete the files by exact date

we have files created by Aug12 and Feb 23 and Mar10
i want to delete the files which has created on Mar 10

Kindly let me know the script to delete the files which is created by Mar 10

itkamaraj's solution is right, mine was wrong

ls -l | grep "Mar 10" | while read line; do fileName=$(echo $line | awk '{print $NF}'); echo "rm $fileName"; done
1 Like

It did not work for me in AIX.

Selecting "Mar 10" only, will display files for different years.

The following will make sure the year, month and day are considered:

#!/usr/bin/ksh
touch -t 201103100000 File_From
touch -t 201103102359 File_To
for mFName in *; do
  if [[ ${mFName} -nt File_From && $mFName -ot File_To ]]; then
    echo "Now removing <${mFName}>"
    rm ${mFName}
  fi
done