Write a command to print the last line of a file?

The tail command can be used to display the last lines from a file.
tail -1 filename
Alternative solutions are:
sed -n ‘$ p’ filename
awk ‘END{print $0}’ filename

Category: UNIX Interview Questions.