The Sed FAQ
pement.org
The Sed FAQ
1–10 of 15 posts
Re: The Sed FAQ
#2Single page text version here: http://www.pement.org/sed/sedfaq.txt
Re: The Sed FAQ
#3Re: The Sed FAQ
#4Re: The Sed FAQ
#5Why not publish MAN itself
also reading the ed man page will help as well for newbies.
--------------------------
IEEE Std 1003.1-2008 :
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ed...
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ex...
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/se...
Re: The Sed FAQ
#6My traditional reference for sed syntax (though hardly so well-explained, it can usually get the job done). https://www.google.com/search?q=sed+one+liners
Re: The Sed FAQ
#7Re: The Sed FAQ
#8Re: The Sed FAQ
#9My favourite use case is when ssh complains about a host key being changed. I just substitute the offending line number into this: sed -i d ~/.ssh/known_hosts and I'm done. Obviously I don't do that thoughtlessly otherwise I'd just disable ssh hosts checking altogether.
for example:
Offending key in /home/user/.ssh/known_hosts:12
ed .ssh/known_hosts
12d
w
q