Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sed + need to remove each line in file that begin with ###

Tags:

sed

How to remove line that begins with three #

For example need to delete all the following lines: from file

1 ### bla bla bal

2 ###blablabla

3 ### blabla

. . .

THX Yael

like image 746
yael Avatar asked Jan 21 '23 21:01

yael


2 Answers

cat file | sed '/^###/d'
like image 60
Steve Weet Avatar answered Jan 24 '23 09:01

Steve Weet


you can use awk as well

awk '!/^[ \t]*###/' file
like image 20
ghostdog74 Avatar answered Jan 24 '23 10:01

ghostdog74