Delete multiple files that contain spaces based on age

I had a problem on a FTP server running Solaris 9 that had tons of old files and many of them had spaces in the names. How do you automate removing the old files (the real concern being the spaces in the filenames)? Most solutions recommend using -print0 in find or xargs -0, neither of which are options in Solaris 9.

This command removes any files older then 2 years old in the current directory:

find . -type f -mtime +730 | while read filename; do rm -f “$filename”; done





Please VOTE for this page at: ADD TO DEL.ICIO.US | ADD TO DIGG | ADD TO FURL | ADD TO NEWSVINE | ADD TO NETSCAPE | ADD TO REDDIT | ADD TO STUMBLEUPON | ADD TO TECHNORATI FAVORITES | ADD TO SQUIDOO | ADD TO WINDOWS LIVE | ADD TO YAHOO MYWEB | ADD TO ASK | ADD TO GOOGLE


Leave a reply