sed 'NUMq;d' file
Where NUM is the number of the line you want to print; so, for example sed ’10q;d’ file to print the 10th line of file.
Explanation:
NUMq will quit immediately when the line number is NUM
.
d will delete the line instead of printing it; this is inhibited on the last line because the q causes the rest of the script to be skipped when quitting.
If you have NUM in a variable, you will want to use double quotes instead of single:
sed "${NUM}q;d" file
Source: https://stackoverflow.com/questions/6022384/bash-tool-to-get-nth-line-from-a-file