[kwlug-disc] comment matching lines in multiple files

Richard Weait richard at weait.com
Sun Sep 20 16:04:14 EDT 2009


Dear Lazyweb,

I have many files, some have lines containing "foobar" in the line
somewhere.  I want to comment every line that contains "foobar" with a
leading "#".  From bash.

I'm presuming that there are bash, awk, find, sed and perl one liners for this.

Best regards,
Richard



More information about the kwlug-disc_kwlug.org mailing list