Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@peaeater
Created August 22, 2013 17:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peaeater/6309960 to your computer and use it in GitHub Desktop.
Save peaeater/6309960 to your computer and use it in GitHub Desktop.
Replace a portion of a filename in a list of filenames with regex.
ls * -name | ren -newname {$_ -replace '^(.*)-replaceme-(.*)$', '$1-newvalue-$2'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment