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

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -