Skip to content

Instantly share code, notes, and snippets.

@michaelrhodes
Created May 5, 2014 02:36
Show Gist options
  • Save michaelrhodes/214bd13c76a95d9de090 to your computer and use it in GitHub Desktop.
Save michaelrhodes/214bd13c76a95d9de090 to your computer and use it in GitHub Desktop.
slugify the files of your working directory
#!/usr/bin/env bash
for file in $(pwd)/*
do
result=$(echo $(basename $file | tr 'A-Z' 'a-z') | tr ' ' '-')
mv "$file" $result
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment