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.


Popular posts from this blog

Php - Delimiter must not be alphanumeric or backslash -

c# - How to change the "Applies To" field under folder auditing options programatically (.NET) -

c++ - Ambiguity when using boost::assign::list_of to construct a std::vector -