sed + remove string only in the last line of the file

Viewed 30421

I use the following sed command to remove the line number string from file

sed -i s'/line number//g' file

but what I need to change in sed syntax in order to remove the line number only if it exist in the last line of the file?

2 Answers
Related