Skip to content

Instantly share code, notes, and snippets.

@martinhj
Created March 12, 2019 08:15
Show Gist options
  • Save martinhj/56c979535dead5fd7106049f225fe985 to your computer and use it in GitHub Desktop.
Save martinhj/56c979535dead5fd7106049f225fe985 to your computer and use it in GitHub Desktop.
Bulk rename bash
for file in src/file/path/images/common-name-*
  do
    git mv $file $(echo $file| sed 's/\(.*\)common-name.*/\1/')other-common-name$(echo $file | sed 's/.*common-name\(.*\)/\1/')
  done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment