Created
December 1, 2019 23:48
-
-
Save BillFleming/9cf58245c5544896181ce99cb108edb5 to your computer and use it in GitHub Desktop.
Scripts to rename ".wmv" files in a game's 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
#!/bin/bash | |
# Rename ".wmv" files in all subdirectories to "_.wmv" | |
find . -name '*.wmv' -exec sh -c 'mv "$0" "${0%.wmv}_.wmv"' {} \; -exec echo {} \; |
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 | |
# Rename ".wmv" files in all subdirectories to "_.wmv" then create 0 byte ".wmv" files in their place. | |
find . -name '*.wmv' -exec sh -c 'mv "$0" "${0%.wmv}_.wmv"' {} \; -exec echo {} \; -exec touch "0%" {} \; |
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 | |
# Rename "_.wmv" files in all subdirectories back to ".wmv" | |
find . -name '*_.wmv' -exec echo {} \; -exec sh -c 'mv "$0" "${0//_/}"' {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment