Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think sed pretty much displaced ed. I still use ed but sed offers the same functionality and it's easier to script. One exception is the j command for joining lines.

For better or worse, in some of today's base Linux distributions, you might find ed missing. You will almost always find sed though.



sed is great but it's a stream editor; try moving the last line to the start of the file.


sed '$G;1h;1!H;$!d'


Nice try, but efficiency aside, it breaks.

    $ sed '$G;1h;1!H;$!d' <<<foo | hd
    00000000  66 6f 6f 0a 0a             |foo..|
    00000005
    $




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: