Last active
August 7, 2024 10:35
-
-
Save huevos-y-bacon/6dcd3282ec406ea16a4157fd8bef47c6 to your computer and use it in GitHub Desktop.
Bash - Bulk rename given file extension to another
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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