On Tue, Nov 26, 2002 at 12:08:22PM +0530, Mario Michael da Costa wrote:
> from the find man page, under actions, it is stated that a command can
> be executed with "-exec command" followed by the string `{}' which
> expands to the files found with the find command.
>
> could this same functionality be achived if i use:
> rm `find /home/mario/.ask/queue -ctime +10`
{} expands to the current file find is processing. Hence,
find . -ctime +10 -exec rm -f {} \; would execute rm(1) once per file found,
and might cause largeish overheads.
rm -f `find . -ctime +10` might not work if the argv[] array to rm(1)
becomes really large.
Hence, to process large number of files, use xargs.
find . -ctime +10 | xargs rm -f
And the -print0/-0 technique to handle filenames with spaces in them.
Best to put this in a file, chmod +x it, and run that file from cron.
Binand
--
If you found this helpful, please take some time off to rate it:
http://svcs.affero.net/rm.php?r=binand
-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T
handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help