Print every X line in a file

Date: 2013-07-09

In this example, I’ll print line 20, 40, 60, 80, etc. of data.txt:

awk '(NR%20==0)' data.txt

NF The number of fields in the current input record. NR The total number of input records seen so far.




Thanks for reading this post!


Did you find an issue in this article?

- click on the following Github link
- log into Github with your account
- click on the line number containing the error
- click on the "..." button
- choose "Reference in new issue"
- add a title and your comment
- click "Submit new issue"

Your feedback is much appreciated! πŸ€œπŸΌπŸ€›πŸΌ

You can also drop me a line below!