#!/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 '{}' \;