Skip to content

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.


Posted in: #bash by @


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

More posts