如何使用又拍云的命令行工具upx管理存储

在开发中,网站或者一些安装包等需要用户下载的文件,最好的方式就是放在公有云 CDN 中,常用的公有云 CDN 包括七牛云又拍云、阿里云等,今天介绍的是使用又拍云的 CDN 内容存储。

查看官方文档,管理存储内容可以使用又拍云官网的网页版管理工具、curl或者 Form 表单的方式来管理,作为开发者而言更方便的是使用命令行的管理工具 upx

来自官方的介绍说:

upx is a tool for managing files in UPYUN. Mac, Linux, Windows supported

我们从 GitHub 中查看 upx 的项目主页,它支持常用的 WindowsLinuxmacOS 系统。

以下是我基于 macOS 系统为例介绍 upx 的使用:

  1. 下载 upx 的可执行文件
    从项目的版本下载页中下载最新的版本
    在这里插入图片描述

  2. 将下载的压缩包解压,在文件夹中可以看到可执行文件 upx(在Windows系统中是 .exe文件)

  3. 将可执行文件放置到系统环境变量中;或者在 Linux 或者 macOS 系统中,为可执行文件添加系统链接,比如我的可执行文件都放置在了 ~/Documents/software 文件夹中

    ln -s ~/Documents/software/upx_0.3.5_Darwin_x86_64/upx /usr/local/bin/upx
    
  4. 然后在终端中输入 upx --help 看到帮助信息输出,即证明已经配置成功

    ➜  ~ upx -h
    NAME:
       upx - a tool for driving UpYun Storage
    
    USAGE:
       upx [global options] command [command options] [arguments...]
    
    VERSION:
       v0.3.5 darwin/amd64 go1.15.8
    
    AUTHOR:
       Hongbo.Mo <zjutpolym@gmail.com>
    
    COMMANDS:
       login     Log in to UpYun
       logout    Log out of your UpYun account
       sessions  List all sessions
       switch    Switch to specific session
       info      Current session information
       cd        Change directory
       pwd       Print working directory
       mkdir     Make directory
       ls        List directory or file
       tree      List contents of directories in a tree-like format
       get       Get directory or file
       put       Put directory or file
       rm        Remove directory or file
       sync      Sync local directory to UpYun
       auth      Generate auth string
       post      Post async process task
       purge     refresh CDN cache
       get-db    get db value
       upgrade   upgrade upx to latest version
       help, h   Shows a list of commands or help for one command
    
    GLOBAL OPTIONS:
       --quiet, -q    not verbose
       --auth value   auth string
       --help, -h     show help
       --version, -v  print the version
    
  5. 登录到 upyun

    # 输入服务名即:budget
    # 输入操作员名称(注意不是又拍云账户)
    # 输入操作员密码:(注意不是又拍云的账户密码)
    upx login
    
  6. 查看又拍云的服务信息

    upx info
    
  7. 上传文件到又拍云

    upx put 本地文件/目录 远程文件/目录
    
  8. 以树形方式查看存储的文件

    upx tree
    
  9. 删除文件

    upx rm 删除的文件/目录
    
  10. 退出登录

    upx logout
    

更多内容

前端开发转全栈,目前的技术栈是 Node.js、Python,日常研究 C、C++ 和 Rust,孜孜啃食系统开发和网络设计中~

更多的内容请移步GitHub@ruxf,知乎@如小非,掘金@如小非,或者关注我的公众号@全栈开发师,欢迎来撩~

学到老,写到老,生命不停,编程不止~

加油,打工人~

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

mrmengj

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值