Removing newlines (n) with sed

Today I had to search again on how to remove newline special characters with sed. Thanks to Kamil over at linux.dsplabs.com.au, I found it again rather quickly.

Now, this is just for my own safekeeping, so I don’t end up googling for it again … *shrug*

2 thoughts to “Removing newlines (n) with sed”

  1. That’s so ugly though, isn’t it! When I realised it would look like that, I ran looking for another solution. I found one.

    echo -e “Line containing nnewlines!” | tr -d “n”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.