TECH SOLUTIONS

Click here to edit subtitle

Forums

Post Reply
Forum Home > Unix Learnings > Script - List files in a Given Directory, the files should be created before a Given Date

Sourav Gulati
Site Owner
Posts: 83

#!/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 {} \;


 

--


December 31, 2012 at 3:47 AM Flag Quote & Reply

You must login to post.