This is all it takes. I tried to do the same thing with sed, but I couldn't remember how to do it with sed.
awk 'NR == 10' < file.txt
Given that the awk binary is slightly larger than the sed binary on my box I wonder if I'll get better runtime using sed, since some of the runtime will be affected by loading that binary before executing it. But given that those binaries are so small (on my OS X box), I wonder if it will make a difference.
panzani leetcode$ which sed /usr/bin/sed panzani leetcode$ du -h /usr/bin/sed 20K /usr/bin/sed panzani leetcode$ which awk /usr/bin/awk panzani leetcode$ du -h /usr/bin/awk 52K /usr/bin/awk