Gdrive: How do I list files in a GDrive directory

Created on 14 Jun 2016  路  4Comments  路  Source: prasmussen/gdrive

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?

Most helpful comment

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"

All 4 comments

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"

I also need this.

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

@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"

Was this page helpful?
0 / 5 - 0 ratings

Related issues

unim21 picture unim21  路  4Comments

devova picture devova  路  7Comments

aservet1 picture aservet1  路  5Comments

GaryFurash picture GaryFurash  路  3Comments

skyuuka picture skyuuka  路  4Comments