In bash:
find /foo -iname '*.txt' -exec cp \{\} /dest/ \;
find
will find all the files under the path /foo
matching the wildcard *.txt
, case insensitively (That’s what -iname
means). For each file, find
will execute cp {} /dest/
, with the found file in place of {}
.