"rclone size" How to count files & directories

I’ve got a directory /test. It contains a file filea, a directory dirb and a file in dirb called filec

  \--filea 4K
      \--filec 4K

If i execute find -mindepth 1 | wc -l I get 3. Two files and one directory.

If i do rclone size /test i get:

Total objects: 2
Total size: 8 kBytes (8192 Bytes)

rclone seems to only count files as object, not directories. Is there a way to have it count both?

1 Like

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

Nice to know. I understand your thinking too.

Is there another undocumented command, size2?

Alas no :wink:

I would consider adding a directory count also if you make a new issue on github about it!