[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bash script question

Stephen R Laniel wrote:

The easiest way wouldn't involve the filename at all. If you
know that a file created on date D is stamped with date D --
i.e., if your files all look like so:

(13:09) slaniel@whitehail:~$ ls filename-20061207.tar.gz -rw-r--r-- 1 slaniel slaniel 0 2006-12-07 13:09 filename-20061207.tar.gz

-- then you can just use find(1). You could do something

find directoryName -mtime +X -print0 |xargs -0 rm '{}'

just a related questions, how is the above different from:
$> find directoryName -mtime +X -exec rm -f  '{}' \;


Reply to: