linux - Why it is copying one file only -
it copying 1 file.
find ../../ -type f -name <filename.pdf> -print0 | xargs -0 -i file cp -rv file --target-directory=directory name path
why copying 1 file. want copy file having same name created on different date , different folders.
try this:
cnt=1 find ../../ -type f -name filename.pdf | while read fname f=$(basename $fname) cp $file /target/directory/${f}.${cnt} cnt=$(( $cnt + 1 )) done
give each destination file unique number.