hI
I m very new to unix ,...
I m facing an issue
I have to search though a list of directorys, find all .gz files which are older than 7 days and delete that ,,,
Any one knows a single command to do this ..
Thnks in advance
BInu
hI
I m very new to unix ,...
I m facing an issue
I have to search though a list of directorys, find all .gz files which are older than 7 days and delete that ,,,
Any one knows a single command to do this ..
Thnks in advance
BInu
while read dir
do
find $dir -name '*.gz' -mtime +7 -exec rm -f {} \;
done < dirlistfile
You have to do this becuase find requires one path per command instance.
For a single command, how about this:
find <list of directories> -name \*.gz -mtime +6 -exec echo removing {} \; rm -f {} \;
I know that jim's post has -mtime +7, and I've got +6, but take a look at this thread, and read Perderabo's last post.
thnaks a lot .. it worked