rz,sz是Linux/Unix同Windows进行ZModem文件传输的指令行东西
长处:比ftp指令便利,并且服务器不必翻开FTP服务。
首要先了解有关的两个指令能够供给很便利的操作:
sz:将选定的文件发送(send)到本地机器
rz:运转该指令会弹出一个文件挑选窗口,从本地挑选文件上传到Linux服务器
第一步:下载rzsz-3.48.tar.gz文件
下载地址:http://freeware.sgi.com/source/rzsz/rzsz-3.48.tar.gz
[root@localhost soft]# ll
总计 72
-rw-r–r– 1 root root 65566 2004-05-19 rzsz-3.48.tar.gz
第二步:解压
[root@localhost soft]# tar zxvf rzsz-3.48.tar.gz
src/
src/COPYING
src/Makefile
src/README
src/crc.c
src/crc.doc
src/crctab.c
src/gz
src/mailer.rz
src/minirb.c
src/minirb.doc
src/rbsb.c
src/rz.c
src/rz.doc
src/sz.c
src/sz.doc
src/undos.c
src/undos.doc
src/zm.c
src/zmodem.h
src/zmr.c
src/zupl.t
[root@localhost soft]# cd src/
[root@localhost src]# ll
总计 256
-rw-rw-r– 1 10127 wheel 891 1998-05-30 COPYING
-rw-r–r– 1 10127 wheel 8815 1998-05-30 crc.c
-rw-r–r– 1 10127 wheel 1492 1998-05-30 crc.doc
-rw-r–r– 1 10127 wheel 8764 1998-05-30 crctab.c
-rw-r–r– 1 10127 wheel 22 1998-05-30 gz
-rw-rw-r– 1 10127 wheel 3617 1998-05-30 mailer.rz
-rw-r–r– 1 10127 wheel 8657 1998-05-30 Makefile
-rw-r–r– 1 10127 wheel 2868 1998-05-30 minirb.c
-rw-r–r– 1 10127 wheel 2727 1998-05-30 minirb.doc
-rw-r–r– 1 10127 wheel 10537 1998-05-30 rbsb.c
-rw-r–r– 1 10127 wheel 6164 1998-05-30 README
-rw-r–r– 1 10127 wheel 29902 1998-05-30 rz.c
-rw-rw-r– 1 10127 wheel 19264 1998-05-30 rz.doc
-rw-r–r– 1 10127 wheel 37258 1998-05-30 sz.c
-rw-rw-r– 1 10127 wheel 25679 1998-05-30 sz.doc
-rw-r–r– 1 10127 wheel 7312 1998-05-30 undos.c
-rw-rw-r– 1 10127 wheel 4282 1998-05-30 undos.doc
-rw-r–r– 1 10127 wheel 17736 1998-05-30 zm.c
-rw-r–r– 1 10127 wheel 6577 1998-05-30 zmodem.h
-rw-r–r– 1 10127 wheel 4519 1998-05-30 zmr.c
-rw-r–r– 1 10127 wheel 738 1998-05-30 zupl.t
rzsz的软件包比较特别,没有configure及make install 文件。履行make指令能够看到一些提示
第三步:装置
[root@localhost src]# make
Please study the #ifdefs in crctab.c, rbsb.c, rz.c and sz.c,
make any necessary hacks for oddball or merged SYSV/BSD systems,
then type make SYSTEM where SYSTEM is one of:
posix POSIX compliant systems
aix AIX systems
next NeXtstep v3.x (POSIX)
odt SCO Open Desktop
everest SCO Open Desktop (elf, strict)
sysvr4 SYSTEM 5.4 Unix
sysvr3 SYSTEM 5.3 Unix with mkdir(2), COHERENT 4.2
sysv SYSTEM 3/5 Unix
sysiii SYS III/V Older Unix or Xenix compilers
xenix
Xenix
x386 386 Xenix
bsd Berkeley 4.x BSD, Ultrix, V7
tandy Tandy 6000 Xenix
dnix DIAB Dnix 5.2
dnix5r3 DIAB Dnix 5.3
amiga 3000UX running SVR4
POSIX POSIX compliant systems (SCO Open Desktop, strict)
undos Make the undos, todos, etc. program.
doc Format the man pages with nroff
依据自己的需求挑选make参数,一般选posix就能够
[root@localhost src]# make posix
cc
-O -DPOSIX -DMD=2 rz.c -o rz
size rz
text data bss dec hex filename
31339 1088 10640 43067 a83b rz
rm -f rb rx rc
ln rz rb
ln rz rx
ln rz rc
cc -O -DPOSIX sz.c -o sz
size sz
text
data bss dec hex filename
37316 1224 43344 81884 13fdc sz
rm -f sb sx zcommand zcommandi
ln sz sb
ln sz sx
ln sz zcommand ===============》提示装置成功
ln sz zcommandi
第四步:增加指令
[root@localhost src]# cp rz sz /usr/bin/ 复制到/usr/bin下便利运用
[root@localhost src]# rz 上传本地文件到linux体系下
rz ready. Type “sz file …” to your modem program
Starting zmodem transfer. Press Ctrl C to cancel.
Transferring 1.txt…
Transferring 1.txt…
?rz 3.48 01-27-98 finished.
**** UNREGISTERED COPY *****
Please read the License Agreement in rz.doc
提示:假如Upload files as ASCII打√的话,你上传的文件的MD5值会有问题,那么运用文件也就不能运转.
[root@localhost ~]# ll
总计 56
-rw-r–r– 1 root root 0 01-06 16:07 1.txt
-rw——- 1 root root 894 12-02 19:22 anaconda-ks.cfg
-rw-r–r– 1 root root 1585 12-02 19:22 init.sh
-rw-r–r– 1 root root 20758 12-02 19:22 install.log
-rw-r–r– 1 root root 3497 12-02 19:22 install.log.syslog
drwxr-xr-x 3 root root 4096 01-07 21:53 soft
上传文件地点的方位是履行rz指令时地点的目录
[root@localhost ~]# sz soft/rzsz-3.48.tar.gz 下载linux下文件到本地
rz
Starting zmodem transfer. Press Ctrl C to cancel.
Transferring rzsz-3.48.tar.gz…
100%
64 KB 64 KB/s 00:00:01 0 Errors
rzsz 3.48 01-27-98 finished.
**** UNREGISTERED COPY *****
Please read the License Agreement in sz.doc
默许途径是:C:\Documents and Settings\e30 这个自己界说修正.
第五步:其他
1.假如要移植到ARM中运用,需求修正Makefile.如下:
#vi Makefile
修正CC=arm-linux-gcc
保存退出
#make posix
2.去掉”UNREGISTERED COPY”提示
**** UNREGISTERED COPY *****
Please read the License Agreement in rz.doc
解决方法:
修正Makefile第四行OFLAG= -O 为 OFLAG= -O -DREGISTERED(也能够修正源代码)