However would I usage sed to delete each traces successful a matter record that incorporate a circumstantial drawstring?
To distance the formation and mark the output to modular retired:
sed '/pattern to match/d' ./infileTo straight modify the record – does not activity with BSD sed:
sed -i '/pattern to match/d' ./infileAforesaid, however for BSD sed (Mac OS X and FreeBSD) – does not activity with GNU sed:
sed -i '' '/pattern to match/d' ./infileTo straight modify the record (and make a backup) – plant with BSD and GNU sed:
sed -i.bak '/pattern to match/d' ./infile Location are galore another methods to delete traces with circumstantial drawstring too sed:
AWK
awk '!/pattern/' file > temp && mv temp fileRuby (1.9+)
ruby -i.bak -ne 'print if not /test/' filePerl
perl -ni.bak -e "print unless /pattern/" fileAmmunition (bash Three.2 and future)
while read -r linedo [[ ! $line =~ pattern ]] && echo "$line"done <file > omv o fileGNU grep
grep -v "pattern" file > temp && mv temp fileAnd of class sed (printing the inverse is sooner than existent deletion):
sed -n '/pattern/!p' file Mistake producing weblog contented