Skip to main content
deleted 14 characters in body
Source Link
IconDaemon
  • 19.7k
  • 10
  • 44
  • 60

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 in tactintact. What if I want don't want the subfolders and want to have all the files right in the "styleFiles_chekad" .? However, it is very complicated. Is there a nan easier way to do this? The following command does not work!

cp . -name '*.STY' styleFiles_chekad/

Any help would be greatly appreciated.

CS

PS. Anyone can recommend a good resource for bash scripting?

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 in tact. What if I want don't want the subfolders and want to have all the files right in the "styleFiles_chekad" . However, it is very complicated. Is there a n easier way to do this? The following command does not work!

cp . -name '*.STY' styleFiles_chekad/

Any help would be greatly appreciated.

CS

PS. Anyone can recommend a good resource for bash scripting?

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?

Source Link

Copying all files of specific type to a specific folder using Mac's Terminal

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 in tact. What if I want don't want the subfolders and want to have all the files right in the "styleFiles_chekad" . However, it is very complicated. Is there a n easier way to do this? The following command does not work!

cp . -name '*.STY' styleFiles_chekad/

Any help would be greatly appreciated.

CS

PS. Anyone can recommend a good resource for bash scripting?