Skip to content

Instantly share code, notes, and snippets.

@blahah
Forked from mafintosh/move.sh
Last active April 5, 2017 09:36
Show Gist options
  • Save blahah/c21b4b6bdc2d4767603a99c7f8529996 to your computer and use it in GitHub Desktop.
Save blahah/c21b4b6bdc2d4767603a99c7f8529996 to your computer and use it in GitHub Desktop.
for dir in $(ls); do
splitdir=$(echo $dir | sed -e 's/\(.\)/\1\//g' -e 's/\/$//')
echo $dir to $splitdir
mkdir -p $splitdir
mv $dir/* $splitdir
rmdir $dir
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment