5 ms·
The Sed FAQ
- elux 14y agoNeeds a single page HTML version. Single page text version here: http://www.pement.org/sed/sedfaq.txt http://www.pement.org/sed/sedfaq.txt
- j0hnsn0w 14y agoWhy not publish MAN itself
- UNIXgod 14y agoHere you go! http://man.freebsd.org/sed http://man.freebsd.org/sed 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.html http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ed... http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ex.html http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ex... http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html http://pubs.opengroup.org/onlinepubs/9699919799/utilities/se...
- ISL 14y agoMy 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 https://www.google.com/search?q=sed+one+liners
- pkrumins 14y agoI love seeing my blog posts at the top. :)
- McUsr 14y agoHello. It is always nice with more stuff on sed, Here is a nice link for those wanting to learn the basics: http://www.grymoire.com/Unix/Sed.html http://www.grymoire.com/Unix/Sed.html
- praptak 14y agoMy 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.
- babuskov 14y agoNice collection of one-liners: http://sed.sourceforge.net/sed1line.txt http://sed.sourceforge.net/sed1line.txt
- nickporter 14y agoI always have problems when running sed, especially with capture groups. I can never get the syntax right for non-trivial stuff. I wish there was a sed-like tool that used python or javascript regex syntax!
- _delirium 14y agoperl -pe is my usual replacement for stuff where I want a sed-like filter but PCRE syntax.
- emmelaich 14y agoYep, as soon as my sed gets even slightly complicated I reach for s2p (sed to perl translator). Also see a2p (awk to perl) and find2perl.
- james2vegas 14y agoPerl regexes are PCRE-like, PCRE regexes are Perl-like, they are not the same.