Command line for download random first folder/file

What is the problem you are having with rclone?

NONE

What is your rclone version (output from rclone version)

1.56

Which cloud storage system are you using? (eg Google Drive)

Google drive

assume inside a folder there is 100 subfolder. is there any rclone command line which will select any random file or folder and download it?

Don't think so. But with some shell magic, and/or using mount, it should be easy enough. What OS? What is the purpose, if I may ask?

windows 7

here is the thing i want to achieve

however if rclone has option to download any random file. i could add loop using batch or powershell script

:x
if folder not empty {
rclone download random file download command. after download one random file command run will end
}
go to :x 

I'd use rclone lsf to list the files, then pick one randomly.

I don't know Powershell so I can't help you with that bit!

Here is a "short" :scream: PowerShell command-line which will return the path of a random file from some remote:path:

rclone lsjson remote:path --recursive | ConvertFrom-Json | ForEach-Object { $_ } | Where-Object { -not $_.IsDir } | Get-Random | Select-Object -ExpandProperty Path

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.