Get folder ID for Google Drive directory

What is the problem you are having with rclone?

I need to get the folder ID for a Google Drive directory

Run the command 'rclone version' and share the full output of the command.

rclone v1.59.2

  • os/version: ubuntu 20.04 (64 bit)
  • os/kernel: 5.15.0-58-generic (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.18.6
  • go/linking: static
  • go/tags: none

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

Google Drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone lsjson <remote-path>:<folder_path>

The rclone config contents with secrets removed.


A log from the command with the -vv flag


The command rclone lsjson <remote-path>:<folder_path> creates metadata output for all the files within the directory. However, its not providing the ID of the folder itself

Sorry for jumping the gun. It appears that rclone lsjson only provides information of the objects inside the path if the path is a directory. So, I can get the ID of a directory by passing its parent path. However, was there a reason to ignore the details of the path itself?

Short answer: rclone internals makes that very hard!

Thank you Nick for the response. If I can push it a bit more, is there a way to get the ID of the file/sub-directory from the mountpath? The rclone lsjson does not return the ID if used on the mounted file/fsub-directory

This may work: Remote Control / API

Do it from the parent and use --include to filter the thing you need.

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