Search by directory name?


from my understanding it is only possible to search for files, not directory names. is that correct?

How do you want to search? You can pull or push both.

at the moment when I search, I am doing this:

rclone ls --include "*infinite*" acd:

but it only returns files. I have tried lsd without result…

We’ll. You can search for paths that contain the directory name. Would that work?

rclone ls --include "**infinite/**" acd:

Note the two stars… And I added a / for an anchor so it should match directories better.


rclone ls --include "**infinite/**" acd: returns nothing but rclone ls --include "**infinite**" acd: returns every file with a matching directory name, which is progress.

is there any way to limit the results to directories only? I presume that is what your / is intended to do? any idea why it doesn’t work?

You can’t limit the results to ‘just directories’ but you can search for paths with directories. Directories on these cloud providers aren’t even really directories. If you really need just a directory list and need better searching, you have two options:

  1. mount the cloud provider and use normal linux find/ls commands:

rclone mount acd: /some/dir &
find /some/dir -type d
fusermount -u /some/dir

  1. Script it and parse for directories. This will get messy fast. :slight_smile:

rclone ls --include "**infinite**" robacd: | awk '{print $2}' | nawk '{match($1, "^.*/"); print substr($1, 1, RLENGTH-1)}' | sort -u