Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

How do I list files in a GDrive directory #159

Closed
mikeyfev1 opened this issue Jun 14, 2016 · 4 comments
Closed

How do I list files in a GDrive directory #159

mikeyfev1 opened this issue Jun 14, 2016 · 4 comments

Comments

@mikeyfev1
Copy link

mikeyfev1 commented Jun 14, 2016

I am using an automation tool which automatically reads new GMail and files the attachments on my Google drive in folders. How do I use the GDrive command to list the files in the folder?

@mikeyfev1 mikeyfev1 changed the title How do I list files in a GRdive directory How do I list files in a GDrive directory Jun 14, 2016
@archeious
Copy link

You need to get the ID of the folder this can be done with the list command. If there are a lot of object you will need to use the query option to narrow it down. If you want a list of objects in the root you can use 'root' as the ID e.g.,

./gdrive list --query " 'root' in parents"
or

./gdrive list --query " 'IdOfTheParentFolder' in parents"

@alexanderkjeldaas
Copy link
Contributor

I also need this.

@taewookim
Copy link

taewookim commented Sep 17, 2019

I must be a complete dumbass

parent_folder (parent_id)
└─child_folder (child_id)

So if I want to get the content of the child_folder, is the command:

gdrive list --query "child_id"`

?

i tried both
gdrive list --query "child_id"`

and

gdrive list --query "parent_id"`

Getting error 400 on both

@danieladamspencer
Copy link

@taewookim Are you using the folder name for the parent_id, or are you using the actual ID hash? Also, you need to include the "in parents" part in your query. For example:

./gdrive list --query " 'child_id' in parents"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants