Home Using loop search files from directory and sub directory and copy to single location
 I have a text file in /tmp/tmp2/file1.txt //file1.txt has multiple names (some with spaces). Source : *gz files are available in /app/...../2018/ Destination : /tmp/tmp2/ I need to find *.gz files from a parent directory and its sub-directories . It contains more than 1000 files and I have ready spent close to 2 hours finding only 30 files .... Is there a loop? Where I can use it? I have already tried: for file in cat cal.txt; do cp -p "*.gz" /tmp/tmp2/ ; done  Which apparently didn't work. Can one of you help me with answers?