Skip to content

Instantly share code, notes, and snippets.

@jjgonecrypto
Created March 11, 2016 22:23
Show Gist options
  • Select an option

  • Save jjgonecrypto/e1a18942bcb081ac5aaa to your computer and use it in GitHub Desktop.

Select an option

Save jjgonecrypto/e1a18942bcb081ac5aaa to your computer and use it in GitHub Desktop.
Echo 5 lines before and after line in a file
#Usage echoline LINE_NUMBER FILE
function echoline() { sed -n "$(($1 - 5)),$(($1 + 5))p" $2; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment