My favourite use case is when ssh complains about a host key being changed. I just substitute the offending line number into this: sed -i <line_no>d ~/.ssh/known_hosts and I'm done. Obviously I don't do that thoughtlessly otherwise I'd just disable ssh hosts checking altogether.
I always have problems when running sed, especially with capture groups. I can never get the syntax right for non-trivial stuff.<p>I wish there was a sed-like tool that used python or javascript regex syntax!
Hello. It is always nice with more stuff on sed, Here is a nice link for those wanting to learn the basics: <a href="http://www.grymoire.com/Unix/Sed.html" rel="nofollow">http://www.grymoire.com/Unix/Sed.html</a>
My traditional reference for sed syntax (though hardly so well-explained, it can usually get the job done).<p><a href="https://www.google.com/search?q=sed+one+liners" rel="nofollow">https://www.google.com/search?q=sed+one+liners</a>
Needs a single page HTML version.<p>Single page text version here:
<a href="http://www.pement.org/sed/sedfaq.txt" rel="nofollow">http://www.pement.org/sed/sedfaq.txt</a>