Home Using loop search files from directory and sub directory and copy to single location
Reply: 0

Using loop search files from directory and sub directory and copy to single location

anonymous coder
1#
anonymous coder Published in 2018-02-13 17:15:02Z

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?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.730222 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO