I'm trying to find a way to use perl to remove lines that contain:
errors:
mirror
raid*
pond
I've managed to find:
perl -pi -e "s,errors:,,"
Is there a way to specify all patterns that I'm looking for in one command?
Since you mention Perl you can use:
perl -ne 'print unless /errors:|mirror|raid\*|pond/'
Alternative you can use sed or grep:
sed '/errors:\|mirror\|raid\*\|pond/d'
Or grep with re-v
erse:
grep -v 'errors:\|mirror\|raid\*\|pond'
You can add the -i
nplace flag to both sed and Perl