25 To delete the last word of each line in the file test1
1 sed 's/ */$//' test1
2 sed 's/ *$//' test1
3 sed 's/ *$//' test1
4 sed 's/ *$\/\/' test1