To delete the last word of each line in the file test1
sed 's/ */$//' test1
sed 's/ *$//' test1
sed 's/ *$\/\/' test1