i need to copy all txt files included in a lot of subdirectories into a single directory. Example:
MyDir
Dir1
1.txt
2.txt
Dir2
a.txt
b.txt
e.jpg
Dir3
f.txt
k.txt
MyDestination
How to copy all txt to MyDestination ?
Try using find ...
which will find the relevant txt files and pass them in batches to cp to have it copy them to MyDestination.
What about
cp -R *.txt <destination>