Created
June 21, 2022 06:42
-
-
Save SalvadorP/a683eb9504d3af9fad92ca37a7574751 to your computer and use it in GitHub Desktop.
Rename files based on pattern
This file contains 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 | |
# Renames all files in the actual directory. | |
# Searches for first parameter then changes for the second. | |
for f in *; do mv "$f" "$(echo "$f" | sed s/$1/$2/)"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment