Created
October 26, 2020 08:53
-
-
Save 2KAbhishek/ab3bd7af42dd2a902edd96a3e052c5bb to your computer and use it in GitHub Desktop.
Batch rename extensions of files
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
#!/bin/bash | |
# Rename all *.txt to *.text | |
for f in *.txt; do | |
mv -- "$f" "${f%.txt}.text" | |
done |
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
#!/bin/zsh | |
# Load zmv module | |
autoload -U zmv | |
# Rename all *.txt to *.text | |
zmv '(*).txt' '$1.text' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment