[X4U] Just curious, Emptying trash

Joe Block jpb at apesseekingknowledge.net
Wed Mar 15 09:34:57 PST 2006


On Mar 14, 2006, at 10:43 AM, John Daschbach wrote:

>
> I used MPW a bit in classic but I didn't find it that great.   
> Perhaps it was because all of the standard Unix stuff wasn't  
> there.  On OS X (and Unix) I run most of my shells inside an Emacs  
> buffer.  A useful way to empty the trash is to delete old files  
> automatically.  I usually put the command in a shell script (using  
> chmod u+x) and put that in my crontab.  The following can be used  
> for this
>
> cd /Users/MyHome/.Trash && find . -mtime +30 -exec rm -f {} \;
>
> This will delete any file with a modification time more than 30  
> days old.
>
> Note that with great power comes great responsibility.  If you  
> forget the cd command you can hose your whole directory tree.

The . in your example just tells find to start looking in the current  
directory, so you can specify the path to your .Trash directory  
instead and not have to worry about zapping the wrong files.

	find /Users/MyHome/.Trash -mtime +30 -exec rm -f {} \;

jpb
-- 
Joe Block <jpb at ApesSeekingKnowledge.net>

Computer Science is about lofty design goals and algorithmic  
optimization. System Administration is about cleaning up the  
resulting mess.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2439 bytes
Desc: not available
Url : http://listserver.themacintoshguy.com/pipermail/x4u/attachments/20060315/31fdd1a6/smime.bin


More information about the X4U mailing list