Safely delete vendor with all his products


Is there any way to run a php command via ssh to delete certain vendor products ? I have vendors that have over 30.000 products which I need to delete but deleting the vendor will put me in trouble as it will stop at some point and though the vendor name will be gone from vendors list , thousands of products will be left who knows where… Or maybe there is an addon on that can do that ?