summaryrefslogtreecommitdiff
path: root/.local/bin/mvtr
blob: b48dcb20dd11b3d265f3f843c2d9fb0928e030e5 (plain)
1
2
3
4
5
6
7
#!/bin/sh

# can use ls pipe to sed pipe to bash, similar to eval? see comment at link:
# link also show perl-rename approach
# https://linuxconfig.org/rename-all-files-from-uppercase-to-lowercase-characters
# if only change ' ' to '_' `rename` might be sufficient, for upper to lower case might need perl-rename if want concise
find "$@" -depth -exec sh -c 'mv -nvT -- "$1" "$(echo "$1" | tr "[:upper:] " "[:lower:]_")"' shell '{}' \;