Delete the last line in a text file using sed

sed -i ‘$d’ hobba

-i: to change the file itself, not copy contents to another file or something
$d: delete the last line
hobba: the file name

Unknown's avatar

About Ahmed Tawfik

Cybersecurity Professional, Systems Engineer, OSS & Linux Geek
This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

Leave a comment