darthShadow
(Anagh Kumar Baranwal)
November 10, 2018, 8:10pm
1
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?
ncw
(Nick Craig-Wood)
November 10, 2018, 11:15pm
2
Try the --files-only
flag to lsf
darthShadow
(Anagh Kumar Baranwal)
November 11, 2018, 8:22am
3
Such a simple solution. 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?
ncw
(Nick Craig-Wood)
November 11, 2018, 7:28pm
4
No, and there really should be.
There is an issue about this: Can't make case insensitive filters · Issue #502 · rclone/rclone · GitHub
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!
darthShadow
(Anagh Kumar Baranwal)
November 12, 2018, 11:50am
5
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
ncw
(Nick Craig-Wood)
November 12, 2018, 2:32pm
6
Good thinking!
I’ve implemented the --ignore-case
flag here:
https://beta.rclone.org/branch/v1.44-080-g16f797a7-ignore-case-beta/ (uploaded in 15-30 mins)
ncw
(Nick Craig-Wood)
November 12, 2018, 4:16pm
7
--ignore-case
is now in the latest beta (or will be in 15-30 mins when the build is finished!)
darthShadow
(Anagh Kumar Baranwal)
November 12, 2018, 4:18pm
8
Thanks for this. Will try it out later today.
1 Like