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'