scp命令的简单使用

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命令的简单使用)