Linux系统下传输方式很多,比如:通过FTP SFTP … 等等。linux服务器大多是通过ssh客户端来进行远程的登陆和管理的,使用ssh登陆linux主机以后,如何能够快速的和本地机器进行文件的交互呢,也就是上传和下载文件到服务器和本地,根据RZSZ特性,这里我们通过SecureCRT提供ZModem配合RZSZ传输工具进行讲解
首先先了解与ssh有关的两个命令可以提供很方便的操作:
sz:将选定的文件发送(send)到本地机器
rz:运行该命令会弹出一个文件选择窗口,从本地选择文件上传到Linux服务器
[root@vps2 ~]# wget http://freeware.sgi.com/source/rzsz/rzsz-3.48.tar.gz
--2012-08-10 12:52:42-- http://freeware.sgi.com/source/rzsz/rzsz-3.48.tar.gz
正在解析主机 freeware.sgi.com... 192.48.178.134
Connecting to freeware.sgi.com|192.48.178.134|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:65566 (64K) [application/x-gzip]
Saving to: `rzsz-3.48.tar.gz'
100%[=============================================>] 65,566 23.0K/s in 2.8s
2012-08-10 12:52:46 (23.0 KB/s) - `rzsz-3.48.tar.gz' saved [65566/65566]
[root@vps2 ~]# ls
a anaconda-ks.cfg b d Desktop install.log install.log.syslog lnmp rarlinux-3.8.0.tar.gz rzsz-3.48.tar.gz vhost.sh
[root@vps2 ~]# 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@vps2 ~]# cd src/
COPYING crc.doc gz Makefile minirb.doc README rz.doc sz.doc undos.doc zmodem.h zupl.t
crc.c crctab.c mailer.rz minirb.c rbsb.c rz.c sz.c undos.c zm.c zmr.c
[root@vps2 ~]# cd src/
[root@vps2 src]# make
Please study the #ifdef's 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
[root@vps2 src]# make posix #这条命令就OK 了
cc -O -DPOSIX -DMD=2 rz.c -o rz
size rz
text data bss dec hex filename
25444 648 10464 36556 8ecc 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
30565 708 43072 74345 12269 sz
rm -f sb sx zcommand zcommandi
ln sz sb
ln sz sx
ln sz zcommand
ln sz zcommandi
[root@vps2 src]# ls
COPYING crc.doc gz Makefile minirb.doc rbsb.c README rz rz.doc sx sz.c undos.c zcommand zm.c zmr.c
crc.c crctab.c mailer.rz minirb.c rb rc rx rz.c sb sz sz.doc undos.doc zcommandi zmodem.h zupl.t
[root@vps2 src]# cp rz sz /usr/bin/
ok
转载于:https://blog.51cto.com/lonwey/960200