In a Unix shell, how can I pick a single line from a text file by its line number?
Say I want whatever is at line 3 in animals.txt to be written to stdout (bat bat bat).
monkey monkey monkey
cat cat cat
bat bat bat
horse horse horse
Is there a standard program or simple way to do this?
(There's also the case where the text file does not contain enough lines to contain the line number you ask for)
This is one way:
Here's another: