Created
October 6, 2014 14:52
-
-
Save asaaki/9fd12a9421a72494eda2 to your computer and use it in GitHub Desktop.
Grep a range of lines from a file
This file contains 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
awk 'NR >= 100 && NR <= 300' file.in | |
sed -n '100,300p' file.in | |
# there are also solutions with head+tail, but it's not very intuitive for me | |
# example with bzipped files: | |
bzcat file.in | awk 'NR >= 100 && NR <= 300' | |
bzcat file.in | sed -n '100,300p' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment