grep(1/0)
Replace text across all content
As my content grows, so does my need to make adjustments across dozens of files. I’m familiar with grep and it’s successor, ripgrep, and I’m familiar with sed, but I can never quite remember how to make replacements in-place. Here’s how: rg -il '< backref' | xargs sed -i "" -e 's/backref "\(.*\)"/backref src="\1"/g' First, you retrieve the relative file path of the files you want to change. Technically, you could run the command against every file and it would only operate on content that matches, but there’s no reason to be so inefficient.…