How can I access this repository from terminal? It is the access to my google drive account from the desktop. Is there a way to make it accessible from \home
 
    
    - 13,061
4 Answers
You should use rclone (use apt install rclone to install it) and configure it for "Google Drive". Detailed information on how to configure rclone for "Google Drive" is given at https://rclone.org/drive/.
You can follow the recommendation at the step Google Application Client Id. Check out Making your own client_id, it provides a great guide for setting up client_id (as of June 2023).
Once you've completed the configuration, mount your "Google Drive" with the following command:
rclone -v --vfs-cache-mode writes mount "$rdrive": "$ldrive"
Here $rdrive is the remote: string configured in the reference given above; $ldrive is a local empty directory (like ~/MyGoogleDrive). You should, mkdir "$ldrive" first as rclone won't do that itself. Once executed, the mount command will not return, which means it is working correctly. The specified remote: will be mounted until you press Ctrl+C.
Similarly you can configure and use "Microsoft One Drive" and many other cloud providers. A complete list of the cloud providers supported by rclone can be found at https://rclone.org/.
 
    
    - 13,420
Such Google Drive location is placed in directory like
/run/user/$UID/gvfs/google-drive:host=gmail.com,user=username/
But it is useless because of crypted file names like 1N-QaxXtI-N3PimnrqloO3uNl7Thq3PUB.
 
    
    - 103,263
As far as I know, the synchronism by GNOME is done via gio, which has the path google-drive://username@gmail.com/ on a GUI file manager, but it is actually stored at /run/user/... on your GNU/Linux filesystem.
GIO (Gnome Input/Output) seems to not be optimized to work on terminal. You can even ls through your directories by using gio list -d google-drive://username@gmail.com/path/to/directory, but it does not seem possible to make more sophisticated stuffs, such as symlink...
In nutshell, if you are like me and have a full-based terminal workflow, then maybe I had better to use rclone, which is a terminal program that allows you to get a full control of your files from terminal. It is a little bit trickier to set this up, but it is much more powerful.
 
    
    - 198
Based on @FedKad solution above. Posting a new answer because I exceeded the limit for a comment.
Steps:
- I installed rclone in Ubuntu (sudo apt install rclone)
- Followed the instructions at https://rclone.org/drive/ (choosing Google Drive, option 13, and the rest mostly defaults),
- Got redirected to my Google account, signed in and got authenticated, and finished the rest of the setup.
To mount was a bit more trickier but after seeing this issue https://forum.rclone.org/t/what-does-poll-interval-is-not-supported-by-this-remote-mean/4771 I opted to dump all the other flags and just did
rclone mount "GoogleDrive:" "NameOfMyDriveOnMyLocalMachine"
and it worked wonders.
I am now able to navigate via the Terminal with proper file and directory names.
Do note that you must first create "NameOfMyDriveOnMyLocalMachine" and that's where you'll find your drive files. Also note that the colon after your drive vendor name is necessary inside the quotes.
As stated above, leave the command above hanging, and work from another terminal in a tab or new application.
Hope that simplifies @FedKad's solution above.
 
    
    - 151

