rz和sz

来源:互联网 发布:介数中心性算法 编辑:程序博客网 时间:2024/06/06 05:35

linux和window传送小文件时非常有用:


rz:window下面的文件传到linux时,在linux命令行键入rz :


  1. Usage: rz [options] [filename.if.xmodem]  
  2.   
  3. Receive files with ZMODEM/YMODEM/XMODEM protocol  
  4.   
  5.     (X) option applies to XMODEM only  
  6.   
  7.     (Y) option applies to YMODEM only  
  8.   
  9.     (Z) option applies to ZMODEM only  
  10.   
  11.   -+, --append                append to existing files  
  12.   
  13.   -a, --ascii                 ASCII transfer (change CR/LF to LF)  
  14.   
  15.   -b, --binary                binary transfer  
  16.   
  17.   -B, --bufsize             buffer bytes (N==auto: buffer whole file)  
  18.   
  19.   -c, --with-crc              Use 16 bit CRC (X)  
  20.   
  21.   -C, --allow-remote-commands allow execution of remote commands (Z)  
  22.   
  23.   -D, --null                  write all received data to /dev/null  
  24.   
  25.       --delay-startup       sleep seconds before doing anything  
  26.   
  27.   -e, --escape                Escape control characters (Z)  
  28.   
  29.   -E, --rename                rename any files already existing  
  30.   
  31.       --errors              generate CRC error every bytes (debugging)  
  32.   
  33.   -h, --help                  Help, print this usage message  
  34.   
  35.   -m, --min-bps             stop transmission if BPS below  
  36.   
  37.   -M, --min-bps-time          for at least seconds (default120)  
  38.   
  39.   -O, --disable-timeouts      disable timeout code, wait forever for data  
  40.   
  41.       --o-sync                open output file(s) in synchronous write mode  
  42.   
  43.   -p, --protect               protect existing files  
  44.   
  45.   -q, --quiet                 quiet, no progress reports  
  46.   
  47.   -r, --resume                try to resume interrupted file transfer (Z)  
  48.   
  49.   -R, --restricted            restricted, more secure mode  
  50.   
  51.   -s, --stop-at {HH:MM|+N}    stop transmission at HH:MM or in seconds  
  52.   
  53.   -S, --timesync              request remote time (twice: set local time)  
  54.   
  55.       --syslog[=off]          turn syslog on or off, if possible  
  56.   
  57.   -t, --timeout             set timeout to tenths of second  
  58.   
  59.   -u, --keep-uppercase        keep upper case filenames  
  60.   
  61.   -U, --unrestrict            disable restricted mode (if allowed to)  
  62.   
  63.   -v, --verbose               be verbose, provide debugging information  
  64.   
  65.   -w, --windowsize          Window is bytes (Z)  
  66.   
  67.   -X  --xmodem                use XMODEM protocol  
  68.   
  69.   -y, --overwrite             Yes, clobber existing file if any  
  70.   
  71.       --ymodem                use YMODEM protocol  
  72.   
  73.   -Z, --zmodem                use ZMODEM protocol  

sz命令恰好相反,用于把linux上的文件上传到windows上

具体命令解析如下:

[csharp] view plaincopy
  1. Usage: sz [options] file ...  
  2.   
  3.    or: sz [options] -{c|i} COMMAND  
  4.   
  5. Send file(s) with ZMODEM/YMODEM/XMODEM protocol  
  6.   
  7.     (X) option applies to XMODEM only  
  8.   
  9.     (Y) option applies to YMODEM only  
  10.   
  11.     (Z) option applies to ZMODEM only  
  12.   
  13.   -+, --append                append to existing destination file (Z)  
  14.   
  15.   -2, --twostop               use stop bits  
  16.   
  17.   -4, --try-4k                go up to 4K blocksize  
  18.   
  19.       --start-4k              start with 4K blocksize (doesn't try 8)  
  20.   
  21.   -8, --try-8k                go up to 8K blocksize  
  22.   
  23.       --start-8k              start with 8K blocksize  
  24.   
  25.   -a, --ascii                 ASCII transfer (change CR/LF to LF)  
  26.   
  27.   -b, --binary                binary transfer  
  28.   
  29.   -B, --bufsize             buffer bytes (N==auto: buffer whole file)  
  30.   
  31.   -c, --command COMMAND       execute remote command COMMAND (Z)  
  32.   
  33.   -C, --command-tries       try times to execute command (Z)  
  34.   
  35.   -d, --dot-to-slash          change '.' to '/' in pathnames (Y/Z)  
  36.   
  37.       --delay-startup       sleep seconds before doing anything  
  38.   
  39.   -e, --escape                escape all control characters (Z)  
  40.   
  41.   -E, --rename                force receiver to rename files it already has  
  42.   
  43.   -f, --full-path             send full pathname (Y/Z)  
  44.   
  45.   -i, --immediate-command CMD send remote CMD, return immediately (Z)  
  46.   
  47.   -h, --help                  print this usage message  
  48.   
  49.   -k, --1k                    send 1024 byte packets (X)  
  50.   
  51.   -L, --packetlen           limit subpacket length to bytes (Z)  
  52.   
  53.   -l, --framelen            limit frame length to bytes (l>=L) (Z)  
  54.   
  55.   -m, --min-bps             stop transmission if BPS below  
  56.   
  57.   -M, --min-bps-time          for at least seconds (default120)  
  58.   
  59.   -n, --newer                 send file if source newer (Z)  
  60.   
  61.   -N, --newer-or-longer       send file if source newer or longer (Z)  
  62.   
  63.   -o, --16-bit-crc            use 16 bit CRC instead of 32 bit CRC (Z)  
  64.   
  65.   -O, --disable-timeouts      disable timeout code, wait forever  
  66.   
  67.   -p, --protect               protect existing destination file (Z)  
  68.   
  69.   -r, --resume                resume interrupted file transfer (Z)  
  70.   
  71.   -R, --restricted            restricted, more secure mode  
  72.   
  73.   -q, --quiet                 quiet (no progress reports)  
  74.   
  75.   -s, --stop-at {HH:MM|+N}    stop transmission at HH:MM or in seconds  
  76.   
  77.       --tcp                   build TCP connection to transmit files  
  78.   
  79.       --tcp-server            open socket, wait for connection  
  80.   
  81.   -u, --unlink                unlink file after transmission  
  82.   
  83.   -U, --unrestrict            turn off restricted mode (if allowed to)  
  84.   
  85.   -v, --verbose               be verbose, provide debugging information  
  86.   
  87.   -w, --windowsize          Window is bytes (Z)  
  88.   
  89.   -X, --xmodem                use XMODEM protocol  
  90.   
  91.   -y, --overwrite             overwrite existing files  
  92.   
  93.   -Y, --overwrite-or-skip     overwrite existing files, else skip  
  94.   
  95.       --ymodem                use YMODEM protocol  
  96.   
  97.   -Z, --zmodem                use ZMODEM protocol 

示例如下:

# sz file1 file2

# rz -+   


0 0