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

Be the first to comment

Leave a Reply

Your email address will not be published.