The UNIX and Linux Forums  

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




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 03-21-2005
jerardfjay jerardfjay is offline
Registered User
  
 

Join Date: Feb 2005
Posts: 146
auto delete of files

You could probably try something like the following. However be very wary of where you run this comman due to the "-f" option of the rm command.

cd destination_directory
rm -f `find * -mtime +30 | xargs ls -l | grep -v user1 | grep -v user2 | grep -v user3 | grep -v user4 | awk -F " " '{print $9}'`



jerardfjay