Sed One Liners


Very useful sed one liners...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Sed one-liners explained


I wanted to let you know that I wrote an article "Famous Sed One-Liners Explained" which explains all the sed one-liners in the file sed1line.txt which is floating around the internet.

Hope you find it useful! :)

Peteris Krumins

Remove all empty lines in a text file

$ sed '/^$/d' file >

Post new comment

  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Enter the characters shown in the image.