How to use sed to delete a line that contains text and not leave a carriage return behind

Use the following command to remove a line from a text file that matches your variable.

sed "/text/d" file.txt

Obviously replace text with your text match string and file with your filename.

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.