It works for me
sed '/^all:/ s/$/ anotherthing/' file
The first part is a search pattern, and the second part is a regular lookup using $ to end the line.
If you want to change the file during the process, use the -i option
sed -i '/^all:/ s/$/ anotherthing/' file
Or you can redirect it to another file
sed '/^all:/ s/$/ anotherthing/' file > output
user219882 Mar 06 '12 at 21:00 2012-03-06 21:00
source share