scripts/copy-files.sh

18 lines
391 B
Bash
Raw Normal View History

2021-04-29 13:39:05 +02:00
#!/bin/sh
usage() {
echo "Usage: copy-files.sh <input directory> <output directory>"
echo "<input directory>: directory where the files are located"
2021-04-29 13:39:05 +02:00
echo "<output directory>: directory where the files are copied to"
exit 1
}
if [ $# != 2 ]; then
usage
fi
input=$1
2021-04-29 13:39:05 +02:00
output=$2
find "$input" -type f -iregex '.*\.\(pdf\|doc\|docx\|xlsx\|accdb|\mdb\)' -print0 | xargs -0 cp -t "$output"