Google Drive 客戶端程式 for Linux

Home » go » Google Drive 客戶端程式 for Linux
2015-06-03 go 尚無留言

自從 2012 年 Google Drive 問市以來,Google 就一直宣稱 Google Drive for Linux 的客戶端程式很快會出來,只是還沒有準備好(Drive for Linux isn’t ready just yet.)

幾年的時間過去了,Google Drive 的對手 Dropbox 早就支援 Linux 了(還非常好用),Google Drive for Linux 至今仍沒有釋出。

不過,2014 年,有一位在 Google Drive 平台團隊工作的員工 Burcu Dogan ( rakyll),用 go  語言寫了一個 Google Drive for Linux  的命令列程式,稱為「drive」 ,可以在 Linux 平台下運作,十分好用,專案位址在 https://github.com/rakyll/drive。後來,由於 rakyll 太忙了,專案改由 https://github.com/odeke-em/drive 接手。

這個 drive for Linux 的安裝使用方法如下:

1. 先裝好相關工具:

sudo apt-get install golang git mercurial

2. 下載 drive 並編譯安裝之:

go get -u github.com/odeke-em/drive/cmd/drive

3. 用法:

drive init ~/gdrive

接著使用瀏覽器建立授權:

Visit this URL to get an authorization code
https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=62074******
Paste the authorization code:

然後,就可以對你的 Google Drive 做相關操作了,例如同步一個目錄內容,假設此目錄叫 apps:

cd ~/gdrive

drive pull --matches apps

結果如下:

+ /apps
+ /apps/pub
+ /apps/pub/freesftw
+ /apps/pub/freesftw/freesftw.apk
+ /apps/pub/freesftw/Screenshot_2013-12-01-09-39-40.png

如果要上傳檔案的話,就用 push 囉:

touch apps/pub/freesftw/test.txt
drive push apps

結果如下:

Resolving...
+ /apps/pub/freesftw/test.txt
Addition count 1
Proceed with the changes? [Y/n]:y

drive 這支命令列程式算是不錯用了,聊勝於無,但還是希望 Google 能早日正式推出 Google Drive for Linux。

 

 

LEAVE A COMMENT

three  +  six  =  

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料