Skip to content

Instantly share code, notes, and snippets.

@ollytheninja
Created February 3, 2022 20:12
Show Gist options
  • Select an option

  • Save ollytheninja/179f029c345db369572e2e18840470ef to your computer and use it in GitHub Desktop.

Select an option

Save ollytheninja/179f029c345db369572e2e18840470ef to your computer and use it in GitHub Desktop.
Remove specific lines from a bunch of files
# When you need to remove a tag from a bunch of Terraform
find . -type f -name "*.tf" -exec sed -i -e '/^.*git_commit.*$/d' {} \;
# Probably want to delete the "-e" files that were created for all files that didn't have the tag in them
find . -type f -name "*.tf-e" -delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment