User Tools

Site Tools


sed:print:print_last_line_of_a_file

SED - Print - Print last line of a file

Emulates “tail -1”.

sed '$!d'                    # method 1
sed -n '$p'                  # method 2

NOTE: Equivalent to:

sort -R| head -1
sed/print/print_last_line_of_a_file.txt · Last modified: 2020/12/22 16:06 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki