Copy folder structure without contents
When setting up build processes, I often find myself needing to copy a source directory's folder structure to the build destination, but I don't want to copy the files; just the folder structure.
If you find yourself running into this scenario often too, take a look at this handy bash command:
find IN_DIR/* -type d | sed 's/IN_DIR\///' | xargs -I % mkdir -p OUT_DIR/%
Replace
IN_DIR
andOUT_DIR
with your actual folder names.
Written by Steven Schobert
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#