Created
July 21, 2019 00:30
-
-
Save CodeArtha/27729c023986908c625cf80edecb4084 to your computer and use it in GitHub Desktop.
Bash script to change all files with one extension in a folder 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
| #!/bin/bash | |
| from_ext=".txt" | |
| to_ext=".csv" | |
| for file in *$from_ext; do mv "$file" "$(basename "$file" $from_ext)$to_ext"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment