Skip to content

Instantly share code, notes, and snippets.

@nicdoye

nicdoye/lc.sh

Created Jul 23, 2018
Embed
What would you like to do?
Rename files to lowercase, and change spaces to dashes.
#!/bin/bash
lc() {
for i in * ; do j="$(echo $i | tr '[:upper:]' '[:lower:]' | tr ' ' '-' )" ; [ "$i" != "$j" ] && mv "$i" "$j"; done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.