# \--include-from vs --exclude-from?

**URL:** <https://forum.rclone.org/t/include-from-vs-exclude-from/542>\
**Category:** Help and Support\
**Created:** [December 26, 2016, 6:34pm UTC](https://forum.rclone.org/t/include-from-vs-exclude-from/542 "2016-12-26T18:34:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chbla](https://forum.rclone.org/letter_avatar_proxy/v4/letter/c/bbce88/32.png) [@chbla](https://forum.rclone.org/u/chbla)\
**Post date:** [December 26, 2016, 6:34pm UTC](https://forum.rclone.org/t/include-from-vs-exclude-from/542/1 "2016-12-26T18:34:47Z")

</div>

Hi,

I’ve got a quick question.  
I had an exclude file for --exclude-from with contents:

tmp/  
torrents/

which worked fine. I now decided to include only one dir instead of exclude what I have right now.  
Therefore created a file for --include-from with contents:

photos/

However, it doesn’t seem to work. Only if I use photos/\*\*

Why is this?

Thanks,  
Christoph

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [December 30, 2016, 12:07pm UTC](https://forum.rclone.org/t/include-from-vs-exclude-from/542/2 "2016-12-30T12:07:03Z")

</div>

rclone filters work on the whole path name.

So `photos/` will match a directory called `photos` anywhere in the directory path. so it will match `/a/photos` and `/b/photos`

However it won’t match `/a/photos/a.jpg` - you need the `**` to match everything including / characters.

I suspect you want `/photos/**` which will match the directory in the root `photos` and everything under it.

I expect you are now wondering why in your --exclude-from example `tmp` worked when what you really wanted was `tmp/**`? That is a consequence of rclone optimizing the directory access and not recursing into tmp because it was excluded.

I agree it isn’t entirely consistent though!

---

<div class="post-metadata">

**Author:** ![system](https://forum.rclone.org/uploads/default/original/2X/3/39ad3235f6ffec76ccd0c81616bd55697b4c300d.png) [@system](https://forum.rclone.org/u/system)\
**Post date:** [March 4, 2020, 12:35am UTC](https://forum.rclone.org/t/include-from-vs-exclude-from/542/3 "2020-03-04T00:35:04Z")

</div>

Closed on March 4, 2020, 12:35am UTC


