I have a folder, A, that contains around 100 subfolders, Asub1,Asub2, etc. I am trying to go into each Asub folder, and copy two files back to the A folder. I have the following code:
for D in `find . -type d`
do
cd $D
cp log_* ../
cp *.pdf ../
cd ../
done
However this result in the following error for each sub folder:
cp: cannot stat `log_*': No such file or directory
cp: cannot stat `*.pdf': No such file or directory
Could someone please tell me where I am going wrong in my code?
cdintoAfolder (cd A) and then docp ./*/log_* ./*/*.pdf .find