To delete the last row from a file, you can use the 'sed' command with 'd' and '$' options.
'$' - Match the last line
'd' - Delete pattern space
Use the following command:
sed -i '$d' file_name
$d should be inside the single quote ('). Without a single quote, the command will give an error. If you use a double quote ("), the command will not delete the last record.