Find first occurence of 'splitword' in file:
grep -n "splitword" bigdumpfile.sql | head -1 | cut -d : -f 1
Result is: 86948
Save partial dump:
sed -n 1,86948p bigdumpfile.sql > reduced_dumpfile.sql
- Tags
- bash
Find first occurence of 'splitword' in file:
grep -n "splitword" bigdumpfile.sql | head -1 | cut -d : -f 1
Result is: 86948
Save partial dump:
sed -n 1,86948p bigdumpfile.sql > reduced_dumpfile.sql