Playing around with drupal I had to drop all tables that were created by a module. To do so I used the following chain of commands :
mysql -u your_user -D your_database_name -e "show tables" -s |
egrep "^Whatever_" |
xargs -I "@@" echo mysql -u your_user -D your_database_name -e "DROP TABLE @@"
This will print out all the shell commands to drop the tables beginning with "Whatever_" (note the ^ regex notation). If you want it to actually execute those commands, remove the word "echo".
mysql -u your_user -D your_database_name -e "show tables" -s |
egrep "^Whatever_" |
xargs -I "@@" echo mysql -u your_user -D your_database_name -e "DROP TABLE @@"
This will print out all the shell commands to drop the tables beginning with "Whatever_" (note the ^ regex notation). If you want it to actually execute those commands, remove the word "echo".