Wednesday, 24 April 2013

Unix Shell Script:List files in a created before a given date


 #!/bin/sh
 echo "Please enter date: (yyyy-mm-dd) "
 read dat
 touch --date $dat ./tmp98765
 echo "Please enter directory where files to delete are located: "
 read delpath
 find $delpath -maxdepth 1 -type f -not -newer ./tmp98765 -exec /bin/ls -l {} \;

No comments:

Post a Comment