Sed Print every nth line beginning with in the file
Print only the first line
sed -n '1p' file.txt
Print every third line starting from line 3 (which will print lines 3, 6, 9, etc)
sed -n '0~3p' file.txt
Print every fifth line starting with the second line (which will print lines 2, 7, 12, 17, etc)
sed -n '2~5p' file.txt