Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/kasper9n/my-bash-scripts. My personal bash scripts
Something went wrong. Try again.
315 B · 16 lines
at master
1234567891011121314151617#! /bin/bash
help() { echo "Copy specified files from a directory, keeping the directory structure." echo "" echo "`color 2 Example:` copy-filtered-dir ./from ./to '*.mp4'" echo ""}
if [[ "$#" < 3 ]]; then help; exit 0; fi
FROM="$1"TO="$2"PATTERN="$3"
find "$FROM" -name "$PATTERN" | cpio -pdm "$TO"