Skip to content

Instantly share code, notes, and snippets.

@jordanmerrick
Last active December 17, 2015 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jordanmerrick/5600220 to your computer and use it in GitHub Desktop.
Save jordanmerrick/5600220 to your computer and use it in GitHub Desktop.
Finds any line starting with "tags:" (case insensitive) and converts any tags to lowercase
## This is destructive as it modifies the files in the directory you're currently in (only if they're .md) but always have a backup.
## I've tested this and it works ok for me, converting the tags all to lowercase. This was run in OS X 10.8.3
## Either copy/paste the entire line or create a shell script with it.
perl -pi -w -e 's/(?i)^tags:.*\n$/lc/ge' *.md
@jordanmerrick
Copy link
Author

Thanks to LifeHacker for most of the command, all I did was tweak the regular expression and edit the file type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment