Its about Unix and Linux.
Yes, there are many solutions to that, e.g. see http://mywiki.wooledge.org/BashFAQ/011. Some of them are fast as hell (not reading the whole file) and some are slow but short and much more readable. I am interested in a solution that works on small files < 1MB, that is easy to remember and easy readable and should finish below 1sec. Of course I could write a script or shell alias, but when I come to new installed computers I have to reestablish my environment first, so I prefer a solution that works with most Unix and Linux Distris out of the box, or at least after installing the desired tool via package management. Can someone beat this?:
awk NR==42 file