I have a problem what I want is to use a cat
to gather hundreds of files that I have in different folders that are for days, which in turn has sub-folders.
The next line of code that what you have to do is
put all the files that start with _1_1.msd
in one, but the code used does not work below:
find /media/user/PENDRIVE/DATA/B850/*/b8/folder_1/ -mindepth 1 -maxdepth 1 -mindepth 1 -type d | while read d; do dname=$(basename $d); cat "$d/$dname"*_1_1.msd > /media/user/PENDRIVE/DATA/B850/"$dname"_1_1_b850.msd ; done ;
I know this is for a single file, but it's like I was doing it but it did not work and what I did was to do it in the following way that is very tedious, doing one instruction per day.
#para folder_1 dia 2015167
find /media/user/PENDRIVE/DATA/B850/2015167/b8/folder_1/ -mindepth 1 -maxdepth 1 -mindepth 1 -type d | while read d; do dname=$(basename $d); cat "$d/$dname"*_1_1.msd > /media/user/PENDRIVE/DATA/B850/"$dname"_1_1_b850.msd ; done
find /media/user/PENDRIVE/DATA/B850/2015167/b8/folder_1/ -mindepth 1 -maxdepth 1 -mindepth 1 -type d | while read d; do dname=$(basename $d); cat "$d/$dname"*_1_2.msd > /media/user/PENDRIVE/DATA/B850/"$dname"_1_2_b850.msd ; done
find /media/user/PENDRIVE/DATA/B850/2015167/b8/folder_1/ -mindepth 1 -maxdepth 1 -mindepth 1 -type d | while read d; do dname=$(basename $d); cat "$d/$dname"*_1_3.msd > /media/user/PENDRIVE/DATA/B850/"$dname"_1_3_b850.msd ; done
find /media/user/PENDRIVE/DATA/B850/2015167/b8/folder_1/ -mindepth 1 -maxdepth 1 -mindepth 1 -type d | while read d; do dname=$(basename $d); cat "$d/$dname"*_1_4.msd > /media/user/PENDRIVE/DATA/B850/"$dname"_1_4_b850.msd ; done
find /media/user/PENDRIVE/DATA/B850/2015167/b8/folder_1/ -mindepth 1 -maxdepth 1 -mindepth 1 -type d | while read d; do dname=$(basename $d); cat "$d/$dname"*_1_5.msd > /media/user/PENDRIVE/DATA/B850/"$dname"_1_5_b850.msd ; done
find /media/user/PENDRIVE/DATA/B850/2015167/b8/folder_1/ -mindepth 1 -maxdepth 1 -mindepth 1 -type d | while read d; do dname=$(basename $d); cat "$d/$dname"*_1_6.msd > /media/user/PENDRIVE/DATA/B850/"$dname"_1_6_b850.msd ; done
#para folder_9 dia 2015167
find /media/user/PENDRIVE/DATA/B850/2015167/b8/folder_9/ -mindepth 1 -maxdepth 1 -mindepth 1 -type d | while read d; do dname=$(basename $d); cat "$d/$dname"*_9_1.msd > /media/user/PENDRIVE/DATA/B850/"$dname"_9_1_b850.msd ; done
find /media/user/PENDRIVE/DATA/B850/2015167/b8/folder_9/ -mindepth 1 -maxdepth 1 -mindepth 1 -type d | while read d; do dname=$(basename $d); cat "$d/$dname"*_9_2.msd > /media/user/PENDRIVE/DATA/B850/"$dname"_9_2_b850.msd ; done
find /media/user/PENDRIVE/DATA/B850/2015167/b8/folder_9/ -mindepth 1 -maxdepth 1 -mindepth 1 -type d | while read d; do dname=$(basename $d); cat "$d/$dname"*_9_3.msd > /media/user/PENDRIVE/DATA/B850/"$dname"_9_3_b850.msd ; done
find /media/user/PENDRIVE/DATA/B850/2015167/b8/folder_9/ -mindepth 1 -maxdepth 1 -mindepth 1 -type d | while read d; do dname=$(basename $d); cat "$d/$dname"*_9_4.msd > /media/user/PENDRIVE/DATA/B850/"$dname"_9_4_b850.msd ; done
find /media/user/PENDRIVE/DATA/B850/2015167/b8/folder_9/ -mindepth 1 -maxdepth 1 -mindepth 1 -type d | while read d; do dname=$(basename $d); cat "$d/$dname"*_9_5.msd > /media/user/PENDRIVE/DATA/B850/"$dname"_9_5_b850.msd ; done
find /media/user/PENDRIVE/DATA/B850/2015167/b8/folder_9/ -mindepth 1 -maxdepth 1 -mindepth 1 -type d | while read d; do dname=$(basename $d); cat "$d/$dname"*_9_6.msd > /media/user/PENDRIVE/DATA/B850/"$dname"_9_6_b850.msd ; done
#para folder_1 dia 2015168
find /media/user/PENDRIVE/DATA/B850/2015168/b8/folder_1/ -mindepth 1 -maxdepth 1 -mindepth 1 -type d | while read d; do dname=$(basename $d); cat "$d/$dname"*_1_1.msd > /media/user/PENDRIVE/DATA/B850/"$dname"_1_1_b850.msd ; done
find /media/user/PENDRIVE/DATA/B850/2015168/b8/folder_1/ -mindepth 1 -maxdepth 1 -mindepth 1 -type d | while read d; do dname=$(basename $d); cat "$d/$dname"*_1_2.msd > /media/user/PENDRIVE/DATA/B850/"$dname"_1_2_b850.msd ; done
find /media/user/PENDRIVE/DATA/B850/2015168/b8/folder_1/ -mindepth 1 -maxdepth 1 -mindepth 1 -type d | while read d; do dname=$(basename $d); cat "$d/$dname"*_1_3.msd > /media/user/PENDRIVE/DATA/B850/"$dname"_1_3_b850.msd ; done
find /media/user/PENDRIVE/DATA/B850/2015168/b8/folder_1/ -mindepth 1 -maxdepth 1 -mindepth 1 -type d | while read d; do dname=$(basename $d); cat "$d/$dname"*_1_4.msd > /media/user/PENDRIVE/DATA/B850/"$dname"_1_4_b850.msd ; done
find /media/user/PENDRIVE/DATA/B850/2015168/b8/folder_1/ -mindepth 1 -maxdepth 1 -mindepth 1 -type d | while read d; do dname=$(basename $d); cat "$d/$dname"*_1_5.msd > /media/user/PENDRIVE/DATA/B850/"$dname"_1_5_b850.msd ; done
find /media/user/PENDRIVE/DATA/B850/2015168/b8/folder_1/ -mindepth 1 -maxdepth 1 -mindepth 1 -type d | while read d; do dname=$(basename $d); cat "$d/$dname"*_1_6.msd > /media/user/PENDRIVE/DATA/B850/"$dname"_1_6_b850.msd ; done
#para folder_9 dia 2015168
find /media/user/PENDRIVE/DATA/B850/2015168/b8/folder_9/ -mindepth 1 -maxdepth 1 -mindepth 1 -type d | while read d; do dname=$(basename $d); cat "$d/$dname"*_9_1.msd > /media/user/PENDRIVE/DATA/B850/"$dname"_9_1_b850.msd ; done
find /media/user/PENDRIVE/DATA/B850/2015168/b8/folder_9/ -mindepth 1 -maxdepth 1 -mindepth 1 -type d | while read d; do dname=$(basename $d); cat "$d/$dname"*_9_2.msd > /media/user/PENDRIVE/DATA/B850/"$dname"_9_2_b850.msd ; done
find /media/user/PENDRIVE/DATA/B850/2015168/b8/folder_9/ -mindepth 1 -maxdepth 1 -mindepth 1 -type d | while read d; do dname=$(basename $d); cat "$d/$dname"*_9_3.msd > /media/user/PENDRIVE/DATA/B850/"$dname"_9_3_b850.msd ; done
find /media/user/PENDRIVE/DATA/B850/2015168/b8/folder_9/ -mindepth 1 -maxdepth 1 -mindepth 1 -type d | while read d; do dname=$(basename $d); cat "$d/$dname"*_9_4.msd > /media/user/PENDRIVE/DATA/B850/"$dname"_9_4_b850.msd ; done
find /media/user/PENDRIVE/DATA/B850/2015168/b8/folder_9/ -mindepth 1 -maxdepth 1 -mindepth 1 -type d | while read d; do dname=$(basename $d); cat "$d/$dname"*_9_5.msd > /media/user/PENDRIVE/DATA/B850/"$dname"_9_5_b850.msd ; done
find /media/user/PENDRIVE/DATA/B850/2015168/b8/folder_9/ -mindepth 1 -maxdepth 1 -mindepth 1 -type d | while read d; do dname=$(basename $d); cat "$d/$dname"*_9_6.msd > /media/user/PENDRIVE/DATA/B850/"$dname"_9_6_b850.msd ; done
Any Suggestion?