echo "SHOW TABLES" | mysql -uUSERNAME -pPASSWORD -D DBNAME | grep ^prefix_ | xargs mysqldump -uUSERNAME -pPASSWORD DBNAME | gzip -c > backup.sql.gz
You have to replace USERNAME, PASSWORD and DBNAME twice.
Note: On textdrive you want to add --skip-opt to mysqldump, otherwise the command will abort with an error because privs for lockings tables are missing (for me at least).
To check which tables were backed up, you can use:
zcat test.sql.gz | grep CREATE
Read http://dev.mysql.com/doc/mysql/en/mysqldump.html to find out which other options to add to mysqldump