wojteo wojteo - 8 months ago 59
Bash Question

How to change filenames to lowercase?

I need to change all names of all files in specific directory to lowercases, using bash script. Moreover I don't want to change names of subdirectories, as it was proposed in How to rename all folders and files to lowercase on Linux?

for file in *; do
    [[ -f "$file" ]] && mv "$file" "${file,,}" 2>/dev/null

I'm not sure what version of bash introduced the ${var,,} expansion.