美文网首页
scp命令的简单使用

scp命令的简单使用

作者: _阿佑 | 来源:发表于2016-10-30 14:16 被阅读16次

    scp命令的简单使用


    在远程主机启用了ssh功能的情况下,可以通过scp命令来copy文件:

    • 从本地copy文件(目录)到远程主机
      scp local_path/local_file user_name@host:/remote_path
      scp -r local_path/local_dir user_name@host:/remote_path

    • 从远程主机copy文件(目录)到本地
      scp user_name@host:/path/remote_file local_path
      scp -r user_name@host:/path/remote_dir local_path


    注:local_path可以是绝对路径也可以是相对路径

    scp命令也可以用于远程主机之间的文件copy

    关于scp命令的更多用法可以参考man手册

    相关文章

      网友评论

          本文标题:scp命令的简单使用

          本文链接:https://www.haomeiwen.com/subject/tvcuuttx.html