From 53a2a616d0640c489a5a2c403f7accc19623a3a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Pe=C3=B1a?= Date: Sat, 31 Aug 2013 12:46:33 +0300 Subject: [PATCH] chead sed to remove empty lines --- cheatsheets/sed | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cheatsheets/sed b/cheatsheets/sed index 53cf5ad..5d97e4a 100644 --- a/cheatsheets/sed +++ b/cheatsheets/sed @@ -9,3 +9,6 @@ echo 'It is daytime' | sed 's/day/night/g' # To remove leading spaces sed -i -r 's/^\s+//g' file.txt + +# To remove empty lines +cat file.txt | sed '/^$/d'