Skip to content
Lowercase letters stamped on a page

Alias to Lowercase All Filenames in a Folder

Add the following alias to your ~/.zshrc or ~/.bash_profile and then when youโ€˜re in a directory, you can just type toLowerCase (thanks JavaScript for the camelcase syntax).

alias toLowerCase='for f in *; do mv "$f" "$f.tmp"; mv "$f.tmp" "`echo $f | tr "[:upper:]" "[:lower:]"`"; done'

Make sure you reload your already open terminals with source ~/.zshrc or source ~/.bash_profile.

References:

Posted in: #bash by @ https://danleatherman.com/lowercase-filenames-alias/

Blog image by Valeria Reverdo

Webmentions

These are webmentions via the IndieWeb and webmention.io. Mention this post from your site:

More posts