【树莓派】文件上传下载小工具

之前在树莓派上面上传下载文件,sz,rz总不成功,后来就是用xmanager自带xftp进行上传下载;

其实本身也是可以的,刚才验证可用。

只是需要装一下相关工具就行:

sudo apt-get install lrzsz

基本使用:

rz,上传,直接选择本地文件即可;

sz,下载,参数带上文件名即可;

lifeccp@raspberrypi:~ $ sz --help
sz version 0.12.21rc
Usage: sz [options] file ...
   or: sz [options] -{c|i} COMMAND
Send file(s) with ZMODEM/YMODEM/XMODEM protocol
    (X) = option applies to XMODEM only
    (Y) = option applies to YMODEM only
    (Z) = option applies to ZMODEM only
  -+, --append                append to existing destination file (Z)
  -2, --twostop               use 2 stop bits
  -4, --try-4k                go up to 4K blocksize
      --start-4k              start with 4K blocksize (doesn't try 8)
  -8, --try-8k                go up to 8K blocksize
      --start-8k              start with 8K blocksize
  -a, --ascii                 ASCII transfer (change CR/LF to LF)
  -b, --binary                binary transfer
  -B, --bufsize N             buffer N bytes (N==auto: buffer whole file)
  -c, --command COMMAND       execute remote command COMMAND (Z)
  -C, --command-tries N       try N times to execute a command (Z)
  -d, --dot-to-slash          change '.' to '/' in pathnames (Y/Z)
      --delay-startup N       sleep N seconds before doing anything
  -e, --escape                escape all control characters (Z)
  -E, --rename                force receiver to rename files it already has
  -f, --full-path             send full pathname (Y/Z)
  -i, --immediate-command CMD send remote CMD, return immediately (Z)
  -h, --help                  print this usage message
  -k, --1k                    send 1024 byte packets (X)
  -L, --packetlen N           limit subpacket length to N bytes (Z)
  -l, --framelen N            limit frame length to N bytes (l>=L) (Z)
  -m, --min-bps N             stop transmission if BPS below N
  -M, --min-bps-time N          for at least N seconds (default: 120)
  -n, --newer                 send file if source newer (Z)
  -N, --newer-or-longer       send file if source newer or longer (Z)
  -o, --16-bit-crc            use 16 bit CRC instead of 32 bit CRC (Z)
  -O, --disable-timeouts      disable timeout code, wait forever
  -p, --protect               protect existing destination file (Z)
  -r, --resume                resume interrupted file transfer (Z)
  -R, --restricted            restricted, more secure mode
  -q, --quiet                 quiet (no progress reports)
  -s, --stop-at {HH:MM|+N}    stop transmission at HH:MM or in N seconds
      --tcp-server            open socket, wait for connection (Z)
      --tcp-client ADDR:PORT  open socket, connect to ... (Z)
  -u, --unlink                unlink file after transmission
  -U, --unrestrict            turn off restricted mode (if allowed to)
  -v, --verbose               be verbose, provide debugging information
  -w, --windowsize N          Window is N bytes (Z)
  -X, --xmodem                use XMODEM protocol
  -y, --overwrite             overwrite existing files
  -Y, --overwrite-or-skip     overwrite existing files, else skip
      --ymodem                use YMODEM protocol
  -Z, --zmodem                use ZMODEM protocol

short options use the same arguments as the long ones

 

通常linux服务器是通过ssh客户端来进行远程登录和管理的。

然而如何方便的实现客户端与linux服务器端的文件交互呢?这就需要用到rz(上传)、sz(下载)工具。
在Ubuntu 10.10下安装rz、sz有2个方法,分述如下:
方法1:自动安装
1.1 在终端中,输入命令:
sudo apt-get install lrzsz
方法2:手动安装
2.1 下载
地址:http://www.ohse.de/uwe/software/lrzsz.html
下载到一个压缩包文件:lrzsz-0.12.20.tar.gz
2.2 解压
tar -xzf lrzsz-0.12.20.tar.gz
2.3 安装
cd lrzsz-0.12.20
./configure --prefix=/usr/local/lrzsz
sudo make
sudo make install
2.4 创建连接
cd /usr/bin
sudo ln -s /usr/local/lrzsz/bin/lrz rz
sudo ln -s /usr/local/lrzsz/bin/lsz sz

posted @ 2017-11-29 14:14  念槐聚  阅读(1312)  评论(0编辑  收藏  举报