How to Read Line Number x of a Large File with Awk

The Situation: You have a 600 GB database dump that produces an error on line 7500 when you attempt to import it.

This size is generally too large to work with in vi. Emacs will generally handle large files like this OK, but maybe it isn't available or your emacs fu isn't quite there.

You can easily achieve the solution with Awk, which is usually available by default on most Linux systems.

awk NR==7500 mysql-dump-file.sql

In this example, a DB insert may be one huge line of code. In that case, you may want to pipe the output to more so you can see the table name without having to scroll up.

awk NR==7500 mysql-dump-file.sql | more