web analytics

Unix: rename files to lowercase

It’s very simple to rename the files to lowercase/uppercase using awk:

Lowercase

ls -1rt | awk ‘{ printf("mv %s %s\n", $0, tolower($0)) | "sh" } END { close("sh") }’

Uppercase

ls -1rt | awk ‘{ printf("mv %s %s\n", $0, toupper($0)) | "sh" } END { close("sh") }’