View Single Post
  #5  
Old 16th June 2006, 14:23
flim flim is offline
Junior Member
 
Join Date: Nov 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by erez
I need some help in writing a shell script, it basically need to delete all my older files , the file name structure is like that :

song100000732200506114828.3gp
song100000732200506124528.3gp
song100000732200506214528.3gp
I assume you want to remove unused stuff older than X days. Instead of checking the timestamp within the filenames you could just do something like this:

find /my/directory -name song*3gp -ctime 50 -print| rm -f

which would delete everything min 50 days old

You can test that it picks the right files with something like:
find /my/directory -name song*3gp -ctime 50 -print| ls -l

Cheers
flim
Reply With Quote