Windows与Mac OS X 向Linux文件传输工具lrzsz安装

想用SecureCRT向linux服务器传输文件其实很简单,只需要在对应的linux服务器上安装一个叫做lrzsz的工具即可实现传输。

该工具可以实现从Windows各个版本和Mac OS X各个版本上使用。(只要能用SecureCRT就可以用该工具)

以下针对CentOS(redhat一样)与Ubuntu linux做一个实验:
我本地的SecureCRT环境:Windows 10 64位


CentOS版本(6.5)

直接通过yum就可以安装了,某些老的系统可能需要更新yum源,或者源码安装。

[op@sAno1y ~]$ sudo yum install lszrz
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirrors.pubyun.com
 * extras: mirrors.163.com
 * updates: mirrors.163.com
Setting up Install Process
No package lszrz available.
Error: Nothing to do
[op@sAno1y tar_packages]$ sudo yum install lrzsz
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirrors.pubyun.com
 * extras: mirrors.163.com
 * updates: mirrors.skyshe.cn
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package lrzsz.x86_64 0:0.12.20-27.1.el6 will be installed
--> Finished Dependency Resolution


Dependencies Resolved


=================================================================================================
 Package            Arch                Version                          Repository         Size
=================================================================================================
Installing:
 lrzsz              x86_64              0.12.20-27.1.el6                 base               71 k


Transaction Summary
=================================================================================================
Install       1 Package(s)


Total download size: 71 k
Installed size: 159 k
Is this ok [y/N]: y
Downloading Packages:
lrzsz-0.12.20-27.1.el6.x86_64.rpm                                         |  71 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : lrzsz-0.12.20-27.1.el6.x86_64                                                 1/1 
  Verifying  : lrzsz-0.12.20-27.1.el6.x86_64                                                 1/1 


Installed:
  lrzsz.x86_64 0:0.12.20-27.1.el6                                                                


Complete!

此时输入rz就可以从Windows向linux里上传文件了。( linux目标路径为当前目录)


比如:
[op@sAno1y ~]$ rz
rz waiting to receive.
Starting zmodem transfer.  Press Ctrl+C to cancel.
Transferring mysql-5.6.26.tar.gz...
  100%   32498 KB    8124 KB/sec    00:00:04       0 Errors   



另外一个命令为sz,sz为从linux上向本地(Windows)下载文件。
其默认下载目录为C:\Users\username\Downloads
用法极其简单,比如:
[op@sAno1y ~]$ sz aaa
rz
Starting zmodem transfer.  Press Ctrl+C to cancel.
Transferring aaa...

其中aaa是需要下载到本地的文件名。

若要修改本地下载和上传的目录,需要修改SecureCRT的设置:
在Windows下:
Options--Session Options--Terminal--X/Y/Zmodem 修改upload和download的路径即可。
在Mac OS X下与其类似。



下载命令(sz)用法如下

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


Ubuntu版本(12.04.5)
此处不再赘述,简单的通过包管理工具apt-get就可以安装了。

sAno1y@localhost:~$ sudo apt-get install lrzsz
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  minicom
The following NEW packages will be installed:
  lrzsz
0 upgraded, 1 newly installed, 0 to remove and 100 not upgraded.
2 not fully installed or removed.
Need to get 111 kB of archives.
After this operation, 295 kB of additional disk space will be used.
Get:1 http://mirrors.aliyun.com/ubuntu/ precise/universe lrzsz amd64 0.12.21-5 [111 kB]
Fetched 111 kB in 0s (3,856 kB/s)
Selecting previously unselected package lrzsz.
(Reading database ... 55965 files and directories currently installed.)
Unpacking lrzsz (from .../lrzsz_0.12.21-5_amd64.deb) ...
Processing triggers for man-db ...
Setting up qmail (1.06-4) ...


The hostname -f command returned: $1


Your system needs to have a fully qualified domain name (fqdn) in
order to install the var-qmail packages.


Installation aborted.


dpkg: error processing qmail (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of qmail-run:
 qmail-run depends on qmail (>= 1.06-2.1); however:
  Package qmail is not configured yet.
dpkg: error processing qmail-run (--configure):
 dependency problems - leaving unconfigured
Setting up lrzsz (0.12.21-5) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 qmail
 qmail-run
E: Sub-process /usr/bin/dpkg returned an error code (1)




在Mac OS X下的SecureCRT用法类似(已测试)。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29773961/viewspace-1794475/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29773961/viewspace-1794475/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值