Skip to content

Instantly share code, notes, and snippets.

@huevos-y-bacon
Last active March 29, 2022 16:45
Show Gist options
  • Save huevos-y-bacon/6dcd3282ec406ea16a4157fd8bef47c6 to your computer and use it in GitHub Desktop.
Save huevos-y-bacon/6dcd3282ec406ea16a4157fd8bef47c6 to your computer and use it in GitHub Desktop.
Bulk rename given file extension to another
#!/usr/bin/env bash
# Bulk rename given file extension to another
ext_before=txt
ext_after=extend
for file in *.${ext_before}; do mv "$file" "${file%."${ext_before}"}.${ext_after}"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment