设为首页 收藏本站
查看: 1642|回复: 1

[经验分享] Linux centos通过安装lszrz用CRT实现与Windows互相传文件

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2016-5-30 09:40:11 | 显示全部楼层 |阅读模式
本经验均在CentOSrelease6.7(Final)下操作,如知识有欠缺之处 欢迎批评指正:
lrzsz是一个搭配SecureCRT使用的在linux和windows之间上传下载工具。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
[iyunv@techW ~]# yum install lsrz
Loaded plugins: fastestmirror, security
Setting up Install Process
Determining fastest mirrors
* base: mirrors.sina.cn
* extras: mirrors.yun-idc.com
* updates: mirrors.sina.cn
No package lsrz available.
Error: Nothing to do
[iyunv@techW ~]# yum install lrzsz
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirrors.sina.cn
* extras: mirrors.yun-idc.com
* updates: mirrors.sina.cn
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:01     
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!



在CRT中设置文件存放的目录:
为了查找方便,上传和下载的目录都放在同一个目录中。
QQ截图20160530093956.jpg
rz命令参数的帮助:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
[iyunv@techW ~]# rz --help
rz version 0.12.20
Usage: rz [options] [filename.if.xmodem]
Receive files 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 files
  -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, --with-crc              Use 16 bit CRC (X)
  -C, --allow-remote-commands allow execution of remote commands (Z)
  -D, --null                  write all received data to /dev/null
      --delay-startup N       sleep N seconds before doing anything
  -e, --escape                Escape control characters (Z)
  -E, --rename                rename any files already existing
      --errors N              generate CRC error every N bytes (debugging)
  -h, --help                  Help, print this usage message
  -m, --min-bps N             stop transmission if BPS below N
  -M, --min-bps-time N          for at least N seconds (default: 120)
  -O, --disable-timeouts      disable timeout code, wait forever for data
      --o-sync                open output file(s) in synchronous write mode
  -p, --protect               protect existing files
  -q, --quiet                 quiet, no progress reports
  -r, --resume                try to resume interrupted file transfer (Z)
  -R, --restricted            restricted, more secure mode
  -s, --stop-at {HH:MM|+N}    stop transmission at HH:MM or in N seconds
  -S, --timesync              request remote time (twice: set local time)
      --syslog[=off]          turn syslog on or off, if possible
  -t, --timeout N             set timeout to N tenths of a second
  -u, --keep-uppercase        keep upper case filenames
  -U, --unrestrict            disable 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             Yes, clobber existing file if any
      --ymodem                use YMODEM protocol
  -Z, --zmodem                use ZMODEM protocol
short options use the same arguments as the long ones




使用 rz -y从windows传一个H3C无线控制器产品文档,如图:
1
2
3
4
5
[iyunv@techW ~]# rz -y
rz waiting to receive.
Starting zmodem transfer.  Press Ctrl+C to cancel.
Transferring H3C无线控制器产品 命令参考(E3703P01_R2509P34_R3709P33_R2609P30_R3509P30_R3120P17)-6W107.chm...
  100%    4140 KB    4140 KB/sec    00:00:01       0 Errors



在linux中查看文件上传的文件:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
root@techW ~]# ls -al
total 4224
dr-xr-x---.  2 root root    4096 May 24 02:31 .
dr-xr-xr-x. 26 root root    4096 May 24 00:14 ..
-rw-------.  1 root root    1252 May 16 03:30 anaconda-ks.cfg
-rw-------.  1 root root    4065 May 24 01:16 .bash_history
-rw-r--r--.  1 root root      18 May 20  2009 .bash_logout
-rw-r--r--.  1 root root     176 May 20  2009 .bash_profile
-rw-r--r--.  1 root root     176 Sep 23  2004 .bashrc
-rw-r--r--.  1 root root     100 Sep 23  2004 .cshrc
-rw-r--r--.  1 root root 4240097 Feb 27  2015 H3C无线控制器产品 命令参考(E3703P01_R2509P34_R3709P33_R2609P30_R3509P30_R3120P17)-6W107.chm
-rw-r--r--.  1 root root   22179 May 16 03:30 install.log
-rw-r--r--.  1 root root    5890 May 16 03:27 install.log.syslog
-rw-r--r--.  1 root root       5 May 16 07:04 oldboy.txt
-rw-r--r--.  1 root root     129 Dec  4  2004 .tcshrc
-rw-------.  1 root root    1106 May 16 13:23 .viminfo




sz的命令参数帮助:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
[iyunv@techW ~]# sz --help
sz version 0.12.20
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                   build a TCP connection to transmit files
      --tcp-server            open socket, wait for connection
  -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




写一个aa.txt文档,将“It's a test”写入到aa.txt:

1
2
3
4
[iyunv@techW ~]# echo  "It's a test " > aa.txt
[iyunv@techW ~]#
[iyunv@techW ~]# cat aa.txt
It's a test



将aa.txt上传到Windows中设置好的文件夹:
1
2
3
4
5
[iyunv@techW ~]#  sz -y aa.txt
rz
Starting zmodem transfer.  Press Ctrl+C to cancel.
Transferring aa.txt...
  100%      13 bytes   13 bytes/sec 00:00:01       0 Errors



到Windows的文件夹中查看文件:
QQ截图20160530094002.jpg
上传和下载文件,OK。


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-223757-1-1.html 上篇帖子: NFS文件系统详解 下篇帖子: Ubuntu16.04系统中BusyBox在配置arm交叉编译环境时make失败 Windows Linux
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表