Hurtling through Space

Copy directories while excluding files

04 December 2017

I’m building this blog with Gatsby, a tool for generating static sites relatively easily using a mix of React and markdown. I’ve spent the day pulling down starter kits and playing with them. Now that (I think) I have a relatively useful setup, it’s time to check in my work. If you’re swapping starter kits in an out, you may find that you need to swap ./gits around, or you don’t want to copy them at all. Here’s a tip to help out.

Copy directories while excluding files

rsync -av source/ dest/ --exclude somepath

rsync is a Swiss Army knife of file management awesomeness.


All writings and opinions are my own and not the views of my employer.
All Rights Reserved, except for the parts enumerated below: