How to display certain lines from a text file in Linux?
- by Boaz
Hi,
I guess everyone knows the useful Linux cmd line utilities head and tail. Head allows you to print the first X lines of a file, tail does the same but prints the end of the file. What is a good command to print the middle of a file? something like middle --start 10000000 --count 20 (print the 10,000,000th till th 10,000,010th lines).
I'm looking for something that will deal with large files efficiently. I tried tail -n 10000000 | head 10 and it's horrifically slow.
Thanks,
Boaz