Return to "Console Command Examples" page.testing case conversion
for f in *; do temp="${f}_temp"; mv -- "$f" "$temp"; done && for f in *_temp; do mv -- "$f" "${f%_temp}"; done
for f in *; do mv -- "$f" "$(echo "$f" | tr '[:upper:]' '[:lower:]' | sed 's/ /_/g')"; done && for f in *_temp; do mv -- "$f" "${f%_temp}"; done
for f in *; do temp="${f}_temp"; mv -- "$f" "$temp"; done && for f in *_temp; do mv -- "$f" "$(echo "${f%_temp}" | tr '[:upper:]' '[:lower:]')"; done
Last modified on 20 July 2024, at 13:52