Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Find all folders named ./components/[folder]/docs and copy contents to ./docs/components/[folder]
find . | grep -E "^\./components/(.*)/docs$" | while read -r path; do
folder=$(echo "$path" | sed 's/^.\/components\(.*\)\/docs$/\1/')
mkdir -p ./docs/components/$folder
cp -r $path/* ./docs/components/$folder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment