Created
August 21, 2020 09:01
-
-
Save brankoajzele/c352852f3b12d4d347e7a97646877f34 to your computer and use it in GitHub Desktop.
Recursively replace spaces with underscores in file name
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
find pub/media/catalog/product -depth -name '* *' -type f | while IFS= read -r f ; do mv -i "$f" "$(dirname "$f")/$(basename "$f"|tr ' ' _)" ; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To be executed from the Magento's root directory.