News

New paper!

Monday, September 30, 2019

Modifying multiple files using sed

I wanted to remove error messages in .err files that have nothing to do with actual error in my codes.
For example, to delete all lines that contain letters 'recv' with extension .err,
$ sed -i '/recv/d' *.err

-i is an option to modify the files themselves instead of creating a modified version of files.

Wikipedia - "sed (stream editor) is a Unix utility that parses and transforms text, using a simple, compact programming language"