Using awk you can specify which lines you print. If you wanted to print lines 1-10, you could do this:
awk ‘NR<=10' /path/to/my/file Another way to specify which lines to print is like this: awk 'NR==1 || NR==2' /path/to/my/file This would only print lines 1 and 2. The || denotes or. If you have other requirements, you can use && like this: awk 'NR<=10 && NF>2′ /path/to/my/file
This would print lines 1-10 if they have more than 2 fields (NF).