Hello!
On my old PC with Fedora 35 I have the Google-Drive folder in the ‘Files’. But I don’t know how to access these directory via Terminal. I’ve used df or mount commands, but there is no Google Drive directory. Although, I know when I click on this Google-Drive directory it “mounts” in the system. Maybe it’s not the ‘mount’ command, but another way to share Google Drive on Fedora?
Could I address this directory in Terminal, or it’s not a directory?
No, it isn’t “Fedora’s problem”. Files on a Google drive are not stored like normal files using their “pretty names”. They are stored using some other generated names (not a clue how these are generated). Google drive has an API which allows it to be “mounted” for users to view files and work with them. gvfs includes support to do this, and through gvfs, nautilus has the required support to read the metadata of the files to list them by their “pretty names”. What we’re seeing at the moment in the terminal is the gvfs mount.
See more here:
The terminal command, ls (and any other command that is not aware of this being a Google drive), on the other hand has no idea that this is a special Google drive where files need to be listed in a different way. For it, the files are just that, files—they’re not special in anyway. So ls cannot automatically list the files using their “pretty names”, it lists them using whatever file name they are listed with.
I searched a bit and found some gvfs commands that should get the pretty names etc, for example:
These were deprecated from gvfs at some point, and now we can use the gio commands:
Here’s the commit with some more information:
So, in your Google drive directory, try this:
gio ls -d
and that should list your files with “pretty names”. See man gio for more.
There are also other tools like rclone for mounting these, but again even with rclone, it looks like you have to use rclone specific commands to list contents of the drive, eg. rclone ls .... One still can’t just use ls because of the way the files are stored.