Summary: probably over a million files to delete

From: Gold Sun (goldsun8@yahoo.com.sg)
Date: Sat Aug 27 2005 - 08:09:52 EDT


Thanks all.
 
Some of the replies :
 
A couple replies say I will still some time to complete the
 deletion, so I probably can do
 "nohup <delete command> &
to let it run by itself in the background.
 
As I need to remove files older than 180 days, I chose :
 
cd <dir where files exist>
find . -xdev -type f -mtime +180 -exec rm {} \+ &

==========
 
Other replies :
 
Mount the filesystem with logging on. You can do this without
unmounting
the filesystem
mount -o remout,logging <dev> >filesystem>
 
-----------
 
cd <directory>
find . -name '*2004*12' -o -name '*2004*11*' -o .... | xargs rm -f &
 
-----------
 
1. find . -exec rm {} \;
2. for x in `ls`; do rm $x ; done

-----------
 
You ran into a limitation on the ability of the shell. I have run into
similar problems in the past. Here is how I worked around it. It
requires the use of perl. It will remove all files within the
directory
where executed. Test to verify for yourself how it works.
  ls | perl -ne 'chomp; unlink'

 

                
---------------------------------
Meet your soulmate!
 Yahoo! Asia presents Meetic - where millions of singles gather
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:31:24 EDT