skicka 是一款 go 语言写的 google 云盘 cli 客户端,也是我目前在 vps 上使用过最好用的 google 云盘客户端。
由于 google 官方截至目前,并没有推出 google drive Linux 客户端。虽然 skicka 开源在github 的 google 账户下面,但是项目主页有申明 skicka 不是 google 官方的产品。
skicka 项目 不分发 二进制 文件,所以我们只能手动从源码编译 skicka。
因为 skicka 是 go 语言 写的,所以整个编译过程非常简单。
skicka 安装
首先安装 golang ,golang的安装方法请参考我的另外一篇博文 : golang 安装
因为 go get
会用到 git,所以我们还需要安装 git
debian ubuntu执行 sudo apt install git
fedora 执行 sudo dnf install git
centos 执行 sudo yum install git
然后安装 skicka
go get -v -u github.com/google/skicka
当命令执行完成 skicka 就被安装成功了。如果你是按照这篇博文: golang 安装 设置的话, skicka 编译后的文件会被放在 ~/go/bin,源码会被放在 ~/go/src。
为了方便使用,我们把 skicka 移动到 /usr/bin 目录。这样我们执行 skicka 的时候就不用输入~/go/bin/skicka 才能执行 skicka。直接输入 skicka 就能执行
sudo mv ~/go/bin/skicka /usr/bin/
或者你也可以选择将 ~/go/bin
加入变量环境这里就不详细介绍了
在终端输入 skicka 如果出现类似这样的信息就安装成功了
usage: skicka [skicka options] <command> [command options]
Supported commands are:
cat Print the contents of the given file
download Download a file or folder hierarchy from Drive to the local disk
df Display free space on Drive
du Report disk usage for a folder hierarchy on Drive
fsck Check consistency of files in Drive and local metadata cache
genkey Generate a new encryption key
init Create an initial skicka configuration file
ls List the contents of a folder on Google Drive
mkdir Create a new folder or folder hierarchy on Drive
rm Remove a file or folder on Google Drive
upload Upload a local file or directory hierarchy to Drive
'skicka help' prints more detailed documentation.
skicka 登录
初始化 skicka
skicka init
对 skicka进行登录授权
skicka -no-browser-auth ls
终端会打印一段网址,把这段网址复制进浏览器打开,在浏览器内对 skicka授权,把获得的授权 token 粘贴回终端 然按后回车键。等 skicka 加载完,就登录成功了
skicka的基本使用
skicka help
查看帮助信息skicka df
查看总容量skicka du
查看云盘下的子目录大小skicka ls
查看目录下的文件skicka mkdir
在 google 云盘新建文件夹 ,列如 skicka mkdir /image 会在 google云盘根目录创建 image 文件夹skicka upload
上传文件到 google云盘,列如 skicka upload ~/photo /image 这条命令会把photo目录内的文件全部上传到 google云盘的 image 目录下skicka download
下载 google云盘的文件到本地,列如 skicka download /image ~/bak 这条命令会把 google 云盘 image 目录内的文件全部下载 到 当前用户的 bak 目录下skicka rm
在google 云盘删除文件,列如 skicka rm /image/file.txtskicka rm -r
在google 云盘删除文件夹,列如如 skicka rm -r /image