Skip to content

Instantly share code, notes, and snippets.

@npyoung
Last active March 7, 2017 02:11
Show Gist options
  • Select an option

  • Save npyoung/485c0996b2e30684fa255f29936cd15d to your computer and use it in GitHub Desktop.

Select an option

Save npyoung/485c0996b2e30684fa255f29936cd15d to your computer and use it in GitHub Desktop.
Substring replacement in file names in the working directory
#!/bin/bash
for fn in *;
do mv "$fn" "${fn//$1/$2}";
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment