S3 的一个命令行客户端

使用Golang 实现了一个S3的简易客户端。

目前实现如下功能:

  • 文件的上传
  • 文件的下载
  • 文件的删除
  • 文件大小,更新时间查看

目前已发布1.0.0, 支持Windows和Linux,其他平台自行编译即可。

session config

{
  "id": "",
  "secret": "",
  "endPoint": "",
  "region": ""
}
Usage:
        s3 <command> [arguments]

The commands are:

        put       upload file to s3
        get       download file from s3
        rm        delete file in s3
        ls        list files in s3

Use "s3 <command> " for more information about a command.

upload

Usage of S3 Uploader:

        ./s3 put -c config.json [-d directory] <bucket> <file ...>

        -c config.json  config path
        -d directory    local directory
        bucket          bucket name

download

Usage of S3 Downloader:

        ./s3 get -c config.json [-d directory] [-x] <bucket> <file ...>

        -c config.json  config path
        -d directory    local directory
        -x              set output is stdout
        bucket          bucket name

delete

Usage of S3 Downloader:

        ./s3 rm -c config.json <bucket> <file ...>

        -c config.json  config path
        bucket          bucket name

list

Usage of S3 List:

        ./s3 ls -c config.json [ -h]  <bucket> <pattern>

        -c config.json    config path
        -h                human reading
        bucket            bucket name
        pattern           file pattern

Github 地址: https://github.com/lpflpf/s3-command-line

如需要其他功能,可以提Issue.

相关推荐