How can I copy all files of specific type to a specific folder using Mac's Terminal.
find . -name '*.STY' -type f -print0 | xargs -0 -I '{}' /usr/bin/rsync -avR "{}" "./styleFiles_chekad/"
Above shell script does the job and keeps the folders intact. What if I don't want the subfolders and want to have all the files right in the "styleFiles_chekad"? However, it is very complicated. Is there an easier way to do this? The following command does not work!
cp . -name '*.STY' styleFiles_chekad/
Any help would be greatly appreciated.
PS. Anyone can recommend a good resource for bash scripting?