Created
August 18, 2019 02:15
-
-
Save douglascayers/a41b8fa8ca927ea11ce743096290d3d0 to your computer and use it in GitHub Desktop.
Rename files in all subdirectories.
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
# Finds all files in the current directory and subdirectories | |
# whose filenames match the expression "*.js" (ends with .js) | |
# then renames the files, changing their extension to ".ts". | |
# https://stackoverflow.com/questions/7450818/rename-all-files-in-directory-from-filename-h-to-filename-half | |
for file in $(find . -type f -name "*.js") | |
do | |
mv "$file" "${file/.js/.ts}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment