Listing only Files

I would like to list only the files matching a particular pattern.

I have tried the following commands:

  • rclone lsf -R --include "**2160p**.mkv" "GDrive:Media/TV Shows/" - This list includes the directories containing the files

  • rclone ls --include "**2160p**.mkv" "GDrive:Media/TV Shows/" - This list has only the files but is not machine readable (i.e. has the size too).

I could make do with the second command and remove the sizes using bash, but, was wondering if there is a cleaner way to achieve the same?

Try the --files-only flag to lsf :wink:

Such a simple solution. :smiley: I must have missed this flag in the docs somehow.

Also, is there any way to specify whether the search is case-sensitive or case-insensitive?

No, and there really should be.

There is an issue about this:

I think the only reason it hasn’t got implemented is that we’ve failed to think of a good syntax!

I could easily make a flag to make all globs (the pattern that filters use) case insensitive.

But what if you wanted them on a case by case basis…

Any suggestions appreciated!

I think you should go ahead and implement the global flag for now. Those who want both can simply run the filter twice, once with and once without and then combine the results.

No need to pause on the implementation of a working solution just to get to a perfect solution.

1 Like

Good thinking!

I’ve implemented the --ignore-case flag here: (uploaded in 15-30 mins)

--ignore-case is now in the latest beta :slight_smile: (or will be in 15-30 mins when the build is finished!)

Thanks for this. Will try it out later today.

1 Like