zoukankan      html  css  js  c++  java
  • linux利用scp远程上传下载文件/文件夹

    scp是secure copy的简写,用于在Linux下进行远程拷贝文件的命令,和它类似的命令有cp,不过cp只是在本机进行拷贝不能跨服务器,而且scp传输是加密的。可能会稍微影响一下速度。

    linux利用scp远程上传下载文件/文件夹linux利用scp远程上传下载文件/文件夹

    当你服务器硬盘变为只读 read only system时,用scp可以帮你把文件移出来。另外,scp还非常不占资源,不会提高多少系统负荷,在这一点上,rsync就远远不及它了。虽然 rsync比scp会快一点,但当小文件众多的情况下,rsync会导致硬盘I/O非常高,而scp基本不影响系统正常使用。

    利用scp传输文件
    1、从服务器下载文件
    scp username@servername:/path/filename /tmp/local_destination

    例如

    scp codinglog@192.168.0.101:/home/kimi/test.txt

    192.168.0.101上的/home/kimi/test.txt

     的文件下载到 

    /tmp/local_destination
      2、上传本地文件到服务器 
    scp /path/local_filename username@servername:/path

    例如

    scp /var/www/test.php  codinglog@192.168.0.101:/var/www/

    把本机/var/www/目录下的test.php文件上传到192.168.0.101这台服务器上的/var/www/目录中

      3、从服务器下载整个目录 
    scp -r username@servername:remote_dir/ /tmp/local_dir

    例如:

    scp -r codinglog@192.168.0.101 /home/kimi/test  /tmp/local_dir
    4、上传目录到服务器 
    scp  -r /tmp/local_dir username@servername:remote_dir

    例如:

    scp -r test      codinglog@192.168.0.101:/var/www/

    把当前目录下的test目录上传到服务器的/var/www/ 目录

  • 相关阅读:
    Ubuntu 虚拟机空间不足增加空间笔记
    am335x sd卡启动开启识别emmc kernel 上的改动
    Delphi实现树型结构具体实例
    学习 TTreeView [15]
    delphi中Treeview的使用介绍
    按下F2编辑dxDBTreeView的节点
    dbtreeview
    我的dbtreeview–treeview直接连接数据表_delphi教程
    SqlDbx连接oracle(可用)
    SqlDbx连接oracle(无需安装Oracle客户端)
  • 原文地址:https://www.cnblogs.com/linuxprobe-sarah/p/9902649.html
Copyright © 2011-2022 走看看