Skip to content

Instantly share code, notes, and snippets.

@pixelpogo
Created January 11, 2013 14:09
Show Gist options
  • Save pixelpogo/4510898 to your computer and use it in GitHub Desktop.
Save pixelpogo/4510898 to your computer and use it in GitHub Desktop.
How to show a specific line in a large file.
An example:
During the import of a big sql-dump MySQL encountered an error in Line 8131086:
ERROR 1449 (HY000) at line 8131086: The user specified as a definer ('foo'@'%') does not exist
To fix that problem I had to have a look at this specific line and, to get the context, ten lines before and after that line.
This is how I did it:
$ sed -n '8131076,8131096p' ~/Downloads/dump_2012-12-17.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment