Skip to content
Archive of posts tagged sed

“In-place” editing of files

Temporary files don't bite, so just use them.

Print lines in reverse order

Some silly ways to print lines in reverse order

Removing newlines in text files

A task that comes up every so often, for some reason

“Zero or more”

This usually comes up in a form similar to "I'm running this code: $ echo "foobar 123" | sed 's/[0-9]*/blah/' blahfoobar 123 but I don't get the expected result!" (which they think should be "foobar blah"). The result they get is instead as shown above. Why is that? Remember that the star quantifier "*" means […]

Run a command on all files in a hierarchy

Something that everybody needs to do sooner or later.