My code is this, what I'm trying to accomplish is to make a list of all pdf documents in my computer and then copy all of those documents to my external hard drive in a directory
mkdir /Volumes/Hardrive-1/allpdf
echo "File Locations" > /Volumes/Hardrive-1/allpdf/FileLocations.txt
mdfind pdf >> /Volumes/Hardrive-1/allpdf/FileLocations.txt
find ~/ -iname "*.pdf" -exec cp {} /Volumes/Hardrive-1/allpdf/ \;
When i compile the code and test it, it creates the "allpdf" directory and creates the "FileLocations.txt" file with all the files that contain "pdf" in their names or extensions, but the last part of my code seems to be unable to work and all I get is a "bad path" perhas there's a mistake somewhere? thanks in advance