Skip to content

Instantly share code, notes, and snippets.

@r-pufky
Created June 16, 2018 21:13
Show Gist options
  • Save r-pufky/6c1ea3c2c83294c73f0e7bd62a433340 to your computer and use it in GitHub Desktop.
Save r-pufky/6c1ea3c2c83294c73f0e7bd62a433340 to your computer and use it in GitHub Desktop.
Move files in directory to <filename>/file
find . -type f -prune -exec sh -c 'mkdir -p "${0%.*}" && mv "$0" "${0%.*}"' {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment