Hurtling through Space

Copy directories while excluding files

04 December 2017
Show BibTeX citation

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.

How to cite this blog post:

    author = {Pittman, Cameron},
    title = {Copy directories while excluding files},
    journal = {Hurtling through Space},
    url = {},
    year = {2017},
    month = {December},
    accessed = {Oct 17, 2022}
All writings and opinions are my own and not the views of my employer.
All Rights Reserved, except for the parts enumerated below: