hackers1

This worked for me under OS X 10.11.6 while cleaning up a bulk WordPress-to-Jekyll import. The first command removed _publicize_twitter_user metadata from roughly 500 posts; the original account handle is replaced with @HISTORICAL_HANDLE below.

Historical OS X command, account placeholder

find . -type f -print0 | xargs -0 sed -i '' /" _publicize_twitter_user: '@HISTORICAL_HANDLE'"/d

The quoting is valid: the shell passes one /.../d expression to sed. The -i '' form is the OS X / BSD syntax used here, not a portable GNU sed command.

The second command was intended to remove imported HTML paragraph tags, but the saved copy has lost its search and replacement text. I no longer have enough evidence in this post to reconstruct that expression confidently, so it remains an incomplete historical example rather than a paste-ready command.

Incomplete imported command: the original search / replacement expression has been lost.

find . -type f -print0 | xargs -0 sed -i '' 's///g'

The important lesson survives even if the second command does not: test bulk text transformations on copies or version-controlled files before pointing them at hundreds of posts.

start chant markdown, markdown, markdown /end chant

Sources