Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google site




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 02-03-2006
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 3,007
else have an illustration as follows,


Code:
delcnt=0
for files in `find /path/to/directory -mtime -5 -print`
do
   echo "Deleting file $file"
   /bin/rm $file
   delcnt=$(($delcnt + 1))
done

echo "deleted $delcnt files"