windows 和 linux互传文件后md5的文件校验
在linux中,安装lrzsz。当然windows上的winscp工具和ftp也可以完成从windows上传文件到linux(下载也可以)。【上传和下载过程中,不管是winscp ftp 还是lrzsz都有一个隐藏的问题,有时间我再整理给大家】
1.在yum中查找
[root@localhost ~]# yum search rz Loaded plugins: fastestmirror Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast Determining fastest mirrors * base: mirrors.neusoft.edu.cn * extras: mirrors.cn99.com * updates: mirrors.cn99.com ============================================= N/S matched: rz ============== lrzsz.x86_64 : The lrz and lsz modem communications programs
2.在yum中安装
[root@localhost ~]# yum install -y lrzsz Loaded plugins: fastestmirror Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast base | 3.6 kB 00:00:00 http://ftp.sjtu.edu.cn/centos/7.2.1511/extras/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed to connect to 2001:da8:8000:6023::230: Network is unreachable" Trying other mirror. extras | 3.4 kB 00:00:00 updates | 3.4 kB 00:00:00 extras/7/x86_64/primary_db FAILED 31% [========================- ] 69 kB/s | 2.9 MB 00:01:34 ETA http://mirrors.tuna.tsinghua.edu.cn/centos/7.2.1511/extras/x86_64/repodata/255224094a57c2de7e747fc25441b55e6f210ec0b026d434ebecf8b726e680af-primary.sqlite.bz2: [Errno 12] Timeout on http://mirrors.tuna.tsinghua.edu.cn/centos/7.2.1511/extras/x86_64/repodata/255224094a57c2de7e747fc25441b55e6f210ec0b026d434ebecf8b726e680af-primary.sqlite.bz2: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds') Trying other mirror. (1/2): extras/7/x86_64/primary_db | 166 kB 00:00:03 (2/2): updates/7/x86_64/primary_db | 9.1 MB 00:01:04 Loading mirror speeds from cached hostfile * base: mirrors.neusoft.edu.cn * extras: mirrors.cn99.com * updates: mirrors.cn99.com Resolving Dependencies --> Running transaction check ---> Package lrzsz.x86_64 0:0.12.20-36.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================================================================================================================================================= Package Arch Version Repository Size ================================================================================================================================================================================================================= Installing: lrzsz x86_64 0.12.20-36.el7 base 78 k Transaction Summary ================================================================================================================================================================================================================= Install 1 Package Total download size: 78 k Installed size: 181 k Downloading packages: lrzsz-0.12.20-36.el7.x86_64.rpm | 78 kB 00:00:02 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : lrzsz-0.12.20-36.el7.x86_64 1/1 Verifying : lrzsz-0.12.20-36.el7.x86_64 1/1 Installed: lrzsz.x86_64 0:0.12.20-36.el7
3.将windows上的文件上传到linux服务器上,运行#rz会弹出文件选择界面如下图,选择上传。如果是下载可以用sz。
4.查询在linux上的md5值
[root@localhost ~]# ls anaconda-ks.cfg order.py order.py.bak 优秀作业.zip [root@localhost ~]# md5sum 优秀作业.zip 5b153e0f55f643dbe1006b6533da48d1 优秀作业.zip
5.查询在windows上的md5值
首先要有在windows上查询md5值的工具。例如md5sum.exe、MD5calc.exe.可以百度下载,有很多。绿色版的小工具即可。
6.从而判断,一个文件由windows上,上传到任何其他的linux服务器上,或者是由linux传到windows上文件。进行比较传播过程中有没有文件损坏或者是改变等。