I want to extract only the lines that will restore a specific table from a mysql backup file. The following works. zcat /mnt/backup/full-replication.gz | sed -n -e '/DROP TABLE.*`account_codes`/,/UNLOCK TABLES/p' > account_codes.sql However, the backup file it 9GB in size, so I’d like to stop searching once the ending match […]