You can proceed with some tmp directory as paradigmatic suggests here.
Still, his usage of find ... | xargs rm has the following flaws:
- the list of arguments to
rm will be too long most likely,
- directories will be included in the list causing
rm to fail in the middle, so you'll end up with some files deleted and some not.
I'd use rm as an -exec option within find instead:
find /tmp/ruby -depth -type f -exec rm /opt/{} \;
-type f selects only regular files (you're using rm, not rmdir).
In general I find better to use find -exec instead of find|xargs.
[edit: falling back to xargs]
Upon reading the comments I realized and checked that xargs is actually faster - doesn't fork rm subprocess for each file matching the criteria but feeds rm command with arguments in batches. The too-long-list error I mentioned has been fixed quite a time ago.
Moreover, if you drop -type f condition then rm will print error for directories but delete everything else. This is a good thing as you will have an info about possibly empty directiories for free.