Last active
April 14, 2017 06:21
-
-
Save 62mkv/8f476e3a3477dddda563dbbbda3dc81f to your computer and use it in GitHub Desktop.
bash: sed: how to print X lines of a file starting with a line N
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # show lines 1000-1010 in "filename" file | |
| sed -n '{1000,+100p}' filename | |
| # another option is more simplistic syntax: | |
| sed -n 1000,+10p filename | |
| # also display line numbers: | |
| sed -n '1000,+10{p;=}' filename | |
| # other useful one-liners are available here: http://sed.sourceforge.net/sed1line.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment