Skip to content

Instantly share code, notes, and snippets.

@gukandrew
Created June 14, 2019 12:49
Show Gist options
  • Select an option

  • Save gukandrew/15834e5d66102f6b50e867e96972d5b5 to your computer and use it in GitHub Desktop.

Select an option

Save gukandrew/15834e5d66102f6b50e867e96972d5b5 to your computer and use it in GitHub Desktop.
Shell Batch rename files using string replacement
for file in *string-to-replace*; do
newname=$(echo $file | sed "s/string-to-replace//");
mv $file $newname;
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment