1、获得表结构 # sed -e'/./{H;$!d;}' -e 'x;/CREATE TABLE `city`/!d;q' full.sql>createtable.sql 2、获得INSERT INTO 语句,用于数据的恢复 # grep -i 'INSERT INTO `city`' full.sqll >data.sql & 3.获取单库的备份 # sed -n '/^-- Current Database: `world`/,/^-- Current Database: `/p' all.sql >world.sql