Tip: coping to multiple targets by prefix

Tip: coping to multiple targets by prefix

Blog Linux

If you need to copy one folder to multiples targets using him relative name, you can use xargs for echo command:

This will return all your target folders:

Now, combine the xargs output as parameter for /bin/cp command, specifying the source of copy:

Now, all your targets will have the same files.

References

http://manpages.ubuntu.com/manpages/precise/man1/xargs.1.html

http://manpages.ubuntu.com/manpages/hardy/en/man1/cp.1posix.html