main logo
Subject: Re: [ProLinux] RegEX
Author: "Carl Karsten"
Posted: 2003/09/30 14:34:00
 
View Entire Thread
New Search


$ find ~/temp -atime +15 ( -name *.bmp -o -name *.doc ) -exec echo {} ;

~/ = users home dir (not what you want, but it was here)

-atime +15 = only hits files that have not been accessed for 15 days

-o = logical or

echo = safer than rm.

{} = filename find found, formated so that it will be one parameter (spaces escaped or quoted or somehting)

= escape the next char so the shell dosn't act on it before passing it to find.

Carl K

----- Original Message -----
From: "John Schmerold" <john (at) katy D.O.T com>
To: "ProLinux Email List" <prolinux@leafe.com>
Sent: Tuesday, September 30, 2003 8:59 AM
Subject: [ProLinux] RegEX


> I'm trying to delete junk files from a file server with the following:
> # rm $(find /home/* | grep -i .tmp | grep WRL)
> & Due to spaces in directory names I get:
> rm: cannot remove `/home/data/WORDDATA/Sunday': No such file or directory
> rm: cannot remove `Bulletin/2002': No such file or directory
> rm: cannot remove `Bulletins/~WRL3734.tmp': No such file or directory
>
> A find gives me:
> # find /home/* | grep -i .tmp | grep WRL
> /home/data/WORDDATA/Sunday Bulletin/2002 Bulletins/~WRL3734.tmp
>
> I must be missing something simple. What is it?
>
>
[excessive quoting removed by server]


 
©2003 Carl Karsten
<-- Prior Message New Search Next Message -->