Exclude Hidden Files?



Fairly new to rclone. Just starting using it this evening. I’ve managed to get files uploading to Cloud Drive so off to a good start.

One thing I have noticed is it syncing up the hidden files as well which I don’t want it to do. Can anyone give me an example of a command with an exclude hidden files filter for “rclone sync”.




Which OS are you on?

Do the hidden files have names you can recognise (eg start with a . or something?) Or are they hidden with attributes of the file?



macOS Sierra. Yeah they are mac ones. .DS_Store etc… Couple of other ones. I’ll have to check after the next upload and confirm.


If you can name the files you want excluded then you can use this to exclude them.



Not sure I can name them exactly without seeing what they are first. Sure I can enable show hidden files but to have to specify each one every time will become cumbersome. Can I not use some kind of wildcard? So that any files (or folders) that start with “.” are excluded?


Sure. To exclude all files starting with . you would use --exclude '.*', to exclude all files in a directory starting with . you would use --exclude ‘.*/**’

You can combine the two to make this --exclude '.*{/**,}'

Or put this in a file


And use --exclude-from file which gives you a chance to add other excludes you find


sorry for the n00b question, but how do I exclude the .DS_Store files?

would it be simply:

–exclude “.DS_Store”

(searched for an answer, so hopefully if that’s correct it will help other beginners)


That will exclude a file called .DS_Store anywhere on the filesystem - so looks good to me!


Thanks Nick. Is there a way to remove any “.DS_Store” files that may have already been uploaded to my GDrive whilst testing?


If you use the --delete-excluded with rclone sync flag then it will remove any excluded files. NB this command is very dangerous so test first with --dry-run!

Alternatively find all the DS_Store files like this

rclone ls --include .DS_Store ls drive:

Then delete them like this

rclone delete --include .DS_Store ls drive:


rclone ls --include .DS_Store drive:

thanks (I removed the extra ls in your example and it seemed to work)