I need to copy all lines in a file matching a pattern to a second file.
In detail: I have a sql dump and want to create a second sql file which includes all commands for tables whose name matches dx_postings, dx_postings_archive, and so on. The pattern should be dx_postings.
Any ideas? I'd prefer an awk or sed solution.