Skip to content

Instantly share code, notes, and snippets.

@talpah
Created January 29, 2013 07:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talpah/4662571 to your computer and use it in GitHub Desktop.
Save talpah/4662571 to your computer and use it in GitHub Desktop.
simple bash commands to recreate directory structure from a cloned gist (only condition is that you don't have underscores in the original filenames)
for f in *; do a=$(echo $f | cut -d '_' --output-delimiter='/' -f 2-); b=$(dirname $a); mkdir -p $b; mv $f $a; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment