0
find . -path '/mnt/ftp/ben/brc' -prune -o -iregex '.*\.\(docx\|xls\|txt\|pdf\|xlsm\|doc\|xlsx\|CVS\|csv\)$'  -mtime +730  -delete

I need all docx, xls, txt, xlms, doc files older than 2 years from my ftp server but also want to exclude /mnt/ftp/ben/brc directory. How can I achieve that?

1 Answer 1

-1

Try this

find . -path '/mnt/ftp/ben/brc' -prune -o -iregex '.*\.\(docx\|xls\|txt\|pdf\|xlsm\|doc\|xlsx\|CVS\|csv\)$'  -mtime +730  -print0 | xargs -0 rm
1
  • find . -path '/mnt/ftp/ben/brc' -prune -o -iregex '.*\.(docx\|xls\|txt\|pdf\|xlsm\|doc\|xlsx\|CVS\|csv)$' -mtime +730 -print0 | xargs -0 rm rm: missing operand Try 'rm --help' for more information
    – user37664
    May 6, 2013 at 15:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .