find -depth -name "*.txt" -type -f -exec cp {} Text \; #doesn�t show any pritn out.
("Text" is the folder where I want to send the found files and I�m not sure if it is the correct syntax).
the first part works percfectly
find -depth -name "*.txt" # Works nice showing found files
But my attempt to copy the txt files found to a new folder is failing
I don�t know why.
Maybe you experts could solve this pending issue to my problem.
Thanks for your very good answer. It help me a lot to follow what I wanted. It looks the option "-type" was not correct in this search in my original script.
Obtained results:
find . -name "*.txt" -print -exec cp {} "C:\My Dir\New Dir" \;# It works
#In Uwin -name is insentive, takes *txt and *TXT, but Cygwin only takes *.txt
find . -name "*.txt" -exec cp {} "C:\My Dir\New Dir" \; # It works
#In Uwin -name is insentive, takes *txt and *TXT, but Cygwin only takes *.txt
find -depth -name "*.txt" -exec cp {} "C:\My Dir\New Dir" \; # It works
#In Uwin -name is insentive, takes *txt and *TXT, but Cygwin only takes *.txt
tar cf - $(find . -name *.txt) | (cd "C:\My Dir\New Dir"; tar xf -)# Doesn�t work for me for reasons below
#find: paths must precede expression: input1.txt
#Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|e
#path...] [expression]
#tar: Cowardly refusing to create an empty archive
#Try `tar --help' or `tar --usage' for more information.
#tar: This does not look like a tar archive
#tar: Exiting with failure status due to previous errors
rakeshawasthi and scottn, thanks both for help to get my desired result.