Magento 2.3 Generate Thousands of Files, How to Delete Them?

After we run Magento 2.3 for 3 months, we found there are thousands of files under pub/media/captcha/base, more than 2Gb.  When I use rm -rf * to run these useless files, I got an error message, we can use the following method to delete them:

cd pub/media/captcha/base
du -sh ./
find . -name ‘*png’ -print0 | xargs -0 rm