"rclone size" How to count files & directories

Yes that is correct, rclone size only counts files… This is because some object storage systems (eg s3, swift, gcs) don’t actually store directories at all…

The undocumented command ls2 will do what you want as in list all files and directories, so you could pipe that into wc rclone ls2 -R /path | wc -l

The command ls2 is experimental and will be replaced with a better one, but it will do the same things! Probably lsf for list formatted - the default will be the ls2 output.

1 Like