til

Today I Learned: collection of notes, tips and tricks and stuff I learn from day to day working with computers and technology as an open source contributor and product manager

View project on GitHub

Copy a file to multiple directories

Nifty little trick when you want to replace a single file in multiple directories.

$ find . -name README.txt -print0 | xargs -0 -I{} cp README.txt {}

This is a variation over the following:

References

  • https://www.garron.me/en/linux/find-copy-files-exec-xargs-bash-linux-mac-osx.html