🎃 Valiukas

jump to main content

bash: delete all lines starting with a certain string

Sep 21, 2022

From stackoverflow:

# Test it on a copy of your file first!
file=YOURFILE.txt
cp $file tempcopy
grep -v '^- tags' tempcopy > $file
rm tempcopy